Part Number Hot Search : 
123B3RC B90N6T MBR60 ADUM7234 05111 T2500B 1N629 T1143
Product Description
Full Text Search
 

To Download MC711K4CFNE3 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  m68hc 1 1k/d m68hc11k family t echnical data hcmos microcontroller unit m 6 8h c 11m 6 11m68hc11 m 8 hc11m68hc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
blank f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola 3 mc68hc11k family technical data motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer application by customer?s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola, inc. is an equal opportunity/affirmative action employer. motorola and are registered trademarks of motorola, inc. digitaldna is a trademark of motorola, inc. ? motorola, inc., 2001 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 4 motorola revision history to provide the most up-to-date information, the revision of our documents on the world wide web will be the most current. your printed copy may be an earlier revision. to verify you have the latest information available, refer to: http://www.motorola.com/semiconductors the following revision history table summarizes changes contained in this document. for your convenience, the page number designators have been linked to the appropriate location. revision history date revision level description page number(s) october, 2001 n/a original release n/a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola list of sections 5 technical data ? m68hc11k family list of sections section 1. general description . . . . . . . . . . . . . . . . . . . . 25 section 2. pin description . . . . . . . . . . . . . . . . . . . . . . . . 31 section 3. central processor unit (cpu) . . . . . . . . . . . . 45 section 4. operating modes and on-chip memory . . . . . . . . . . . . . . . . . . . 63 section 5. resets and interrupts . . . . . . . . . . . . . . . . . . 105 section 6. parallel input/output . . . . . . . . . . . . . . . . . . . 135 section 7. serial communications interface (sci) . . . . . . . . . . . . . . . . . . . . . . . . 149 section 8. serial peripheral interface (spi). . . . . . . . . . 167 section 9. timing system. . . . . . . . . . . . . . . . . . . . . . . . 181 section 10. analog-to-digital (a/d) converter . . . . . . . 221 section 11. memory expansion and chip selects. . . . . . . . . . . . . . . . . . . . . . 231 section 12. electrical characteristics . . . . . . . . . . . . . . 253 section 13. mechanical data . . . . . . . . . . . . . . . . . . . . . 273 section 14. ordering information . . . . . . . . . . . . . . . . . 281 section 15. development support . . . . . . . . . . . . . . . . . 283 index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 6 list of sections motorola list of sections f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola table of contents 7 technical data ? m68hc11k family table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.3 m68hc11k family members . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.4 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.5 structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 section 2. pin description 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.3 power supply (v dd , v ss , av dd , and av ss ). . . . . . . . . . . . . . .36 2.4 reset (reset ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.5 crystal driver and external clock input (xtal and extal) . .37 2.6 xout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.7 e-clock output (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8 interrupt request (irq ) and non-maskable interrupt (xirq ) .38 2.9 mode selection, instruction cycle reference, and standby power (moda/lir and modb/v stby ) . . . . . .39 2.10 v rh and v rl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.11 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 8 table of contents motorola table of contents section 3. central processor unit (cpu) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.3.1 accumulators a, b, and d (acca, accb, and accd) . . . . 47 3.3.2 index register x (ix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.3 index register y (iy) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.3.5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . 50 3.3.6.1 carry/borrow (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6.2 overflow (v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.3.6.3 zero (z) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6.4 negative (n) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.5 interrupt mask (i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.6 half carry (h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.7 non-maskable interrupt (x) . . . . . . . . . . . . . . . . . . . . . . .52 3.3.6.8 stop disable (s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 3.4 data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 3.5 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 3.6 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 3.6.1 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.2 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.6.3 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.4 indexed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.5 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 3.6.6 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 3.7 instruction set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents m68hc11k family technical data motorola table of contents 9 section 4. operating modes and on-chip memory 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 4.3 control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 4.4 system initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 4.5 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.1 single-chip mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.2 expanded mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.3 bootstrap mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 4.5.4 special test mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.5.5 mode selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 4.6 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 4.6.1 control registers and ram . . . . . . . . . . . . . . . . . . . . . . . . .84 4.6.2 rom or eprom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 4.6.3 eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.6.4 bootloader rom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 4.7 eprom/otprom (m68hc711k4 and m68hc711ks2). . . . .90 4.7.1 programming the eprom with downloaded data. . . . . . . .90 4.7.2 programming the eprom from memory . . . . . . . . . . . . . . .91 4.8 eeprom and the config register . . . . . . . . . . . . . . . . . . . .93 4.8.1 eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.8.1.1 eeprom programming control register . . . . . . . . . . . .94 4.8.1.2 block protect register . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.8.1.3 system configuration options register . . . . . . . . . . . . . .97 4.8.2 eeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 4.8.2.1 eeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . .98 4.8.2.2 eeprom bulk erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.8.2.3 eeprom row erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.8.2.4 eeprom byte erase . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 4.8.3 config register programming . . . . . . . . . . . . . . . . . . . .100 4.8.4 ram and eeprom security . . . . . . . . . . . . . . . . . . . . . . .100 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 10 table of contents motorola table of contents 4.9 xout pin control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 4.9.1 system configuration register. . . . . . . . . . . . . . . . . . . . . .102 4.9.2 system configuration options 2 register . . . . . . . . . . . . .103 section 5. resets and interrupts 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 5.3 sources of resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 5.3.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . .107 5.3.2 external reset (reset ) . . . . . . . . . . . . . . . . . . . . . . . . . .107 5.3.3 computer operating properly (cop) system . . . . . . . . . .107 5.3.3.1 system configuration register . . . . . . . . . . . . . . . . . . .108 5.3.3.2 system configuration options register . . . . . . . . . . . . .109 5.3.3.3 arm/reset cop timer circuitry register. . . . . . . . . . . .110 5.3.4 clock monitor reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 5.3.4.1 system configuration options register . . . . . . . . . . . . .111 5.3.4.2 system configuration options register 2 . . . . . . . . . . .112 5.4 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 5.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 5.5.1 non-maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . .120 5.5.1.1 non-maskable interrupt request (xirq ) . . . . . . . . . . . .120 5.5.1.2 illegal opcode trap . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 5.5.1.3 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . .121 5.5.2 maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 5.6 reset and interrupt priority. . . . . . . . . . . . . . . . . . . . . . . . . . .122 5.7 reset and interrupt processing . . . . . . . . . . . . . . . . . . . . . . .123 5.8 low-power operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 5.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 5.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 5.8.3 slow mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents m68hc11k family technical data motorola table of contents 11 section 6. parallel input/output 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136 6.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 6.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 6.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 6.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142 6.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 6.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 6.9 port g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 6.10 port h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 6.11 internal pullup resistors. . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 section 7. serial communications interface (sci) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 7.3 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 7.4 transmit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 7.5 receive operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 7.6 wakeup feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 7.7 short mode idle line detection . . . . . . . . . . . . . . . . . . . . . . .157 7.8 baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 7.9 sci registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 7.9.1 sci baud rate control register . . . . . . . . . . . . . . . . . . . .158 7.9.2 serial communications control register 1 . . . . . . . . . . . .160 7.9.3 serial communications control register 2 . . . . . . . . . . . .161 7.9.4 serial communication status register 1 . . . . . . . . . . . . . .162 7.9.5 serial communication status register 2 . . . . . . . . . . . . . .164 7.9.6 serial communications data register . . . . . . . . . . . . . . . .165 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 12 table of contents motorola table of contents section 8. serial peripheral interface (spi) 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167 8.3 spi functional description . . . . . . . . . . . . . . . . . . . . . . . . . . .168 8.4 spi signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.1 master in slave out (miso) . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.2 master out slave in (mosi) . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.3 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 8.4.4 slave select (ss ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 8.4.5 spi timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 8.5 spi system errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 8.5.1 mode fault error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 8.5.2 write collision error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 8.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173 8.6.1 serial peripheral control register . . . . . . . . . . . . . . . . . . .174 8.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . . .176 8.6.3 serial peripheral data register . . . . . . . . . . . . . . . . . . . . .177 8.6.4 port d data direction register . . . . . . . . . . . . . . . . . . . . . .178 8.6.5 system configuration options 2. . . . . . . . . . . . . . . . . . . . .179 section 9. timing system 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182 9.3 timer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183 9.4 input capture and output compare overview . . . . . . . . . . . .185 9.4.1 timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . . .188 9.4.2 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .189 9.4.3 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .189 9.4.4 port a data direction register . . . . . . . . . . . . . . . . . . . . . .190 9.4.5 pulse accumulator control register . . . . . . . . . . . . . . . . . 191 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents m68hc11k family technical data motorola table of contents 13 9.5 input capture (ic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191 9.5.1 timer input capture registers . . . . . . . . . . . . . . . . . . . . . .192 9.5.2 timer input capture 4/output compare 5 register . . . . . .193 9.5.3 timer interrupt flag 1 register . . . . . . . . . . . . . . . . . . . . .194 9.5.4 timer interrupt mask 1 register. . . . . . . . . . . . . . . . . . . . .194 9.5.5 timer control 2 register . . . . . . . . . . . . . . . . . . . . . . . . . .195 9.6 output compare (oc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196 9.6.1 timer output compare registers . . . . . . . . . . . . . . . . . . .197 9.6.2 timer input capture 4/output compare 5 register . . . . . .199 9.6.3 timer interrupt flag 1 register . . . . . . . . . . . . . . . . . . . . .199 9.6.4 timer interrupt mask 1 register. . . . . . . . . . . . . . . . . . . . .200 9.6.5 timer control 1 register . . . . . . . . . . . . . . . . . . . . . . . . . .200 9.6.6 timer compare force register . . . . . . . . . . . . . . . . . . . . .201 9.6.7 output compare 1 mask register . . . . . . . . . . . . . . . . . . .202 9.6.8 output compare 1 data register. . . . . . . . . . . . . . . . . . . .202 9.7 pulse accumulator (pa) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 9.7.1 port a data direction register . . . . . . . . . . . . . . . . . . . . . .205 9.7.2 pulse accumulator control register . . . . . . . . . . . . . . . . . 205 9.7.3 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .206 9.7.4 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .207 9.7.5 pulse accumulator count register . . . . . . . . . . . . . . . . . .208 9.8 real-time interrupt (rti) . . . . . . . . . . . . . . . . . . . . . . . . . . . .208 9.8.1 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .209 9.8.2 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .209 9.8.3 pulse accumulator control register . . . . . . . . . . . . . . . . . 210 9.9 pulse-width modulator (pwm) . . . . . . . . . . . . . . . . . . . . . . . .211 9.9.1 pwm system description. . . . . . . . . . . . . . . . . . . . . . . . . .211 9.9.2 pulse-width modulation control registers. . . . . . . . . . . . .213 9.9.2.1 pulse-width modulation timer clock select register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 9.9.2.2 pulse-width modulation timer polarity register . . . . . .215 9.9.2.3 pulse-width modulation timer prescaler register . . . .215 9.9.2.4 pulse-width modulation timer enable register . . . . . .216 9.9.2.5 pulse-width modulation timer counters 1 to 4 registers . . . . . . . . . . . . . . . . . . . . .217 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 14 table of contents motorola table of contents 9.9.2.6 pulse-width modulation timer periods 1 to 4 registers . . . . . . . . . . . . . . . . . . . . . .218 9.9.2.7 pulse-width modulation timer duty cycle 1 to 4 registers . . . . . . . . . . . . . . . . . . . . . . . . 219 section 10. analog-to-digital (a/d) converter 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 10.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222 10.3.1 multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.2 analog converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.3 result registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.4 digital control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 10.4 a/d control/status registers . . . . . . . . . . . . . . . . . . . . . . . . . 226 10.4.1 system configuration options register . . . . . . . . . . . . . . .226 10.4.2 a/d control/status register . . . . . . . . . . . . . . . . . . . . . . . . 227 10.4.3 analog-to-digital converter result registers. . . . . . . . . . .229 10.5 design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 10.5.1 a/d input pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 10.5.2 operation in stop and wait modes . . . . . . . . . . . . . . . . . .230 section 11. memory expansion and chip selects 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 11.3 memory expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232 11.3.1 memory size and address line allocation. . . . . . . . . . . . .232 11.3.2 control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234 11.3.2.1 port g assignment register . . . . . . . . . . . . . . . . . . . . .234 11.3.2.2 memory mapping size register . . . . . . . . . . . . . . . . . . .235 11.3.2.3 memory mapping window base register . . . . . . . . . . .236 11.3.2.4 memory mapping window control registers. . . . . . . . .237 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents m68hc11k family technical data motorola table of contents 15 11.4 chip selects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 11.4.1 program chip select . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240 11.4.2 input/output chip select . . . . . . . . . . . . . . . . . . . . . . . . . . 241 11.4.3 general-purpose chip selects. . . . . . . . . . . . . . . . . . . . . .242 11.4.3.1 memory mapping size register . . . . . . . . . . . . . . . . . . .243 11.4.3.2 general-purpose chip select 1 address register. . . . .243 11.4.3.3 general-purpose chip select 1 control register . . . . .244 11.4.3.4 general-purpose chip select 2 address register. . . . .245 11.4.3.5 general-purpose chip select 2 control register . . . . .245 11.4.4 one chip select driving another . . . . . . . . . . . . . . . . . . . . 246 11.4.4.1 general-purpose chip select 1 control register . . . . .247 11.4.4.2 general-purpose chip select 2 control register . . . . .247 11.4.5 clock stretching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248 11.5 memory expansion examples . . . . . . . . . . . . . . . . . . . . . . . .249 section 12. electrical characteristics 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .254 12.3 maximum ratings for standard devices . . . . . . . . . . . . . . . .254 12.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . .255 12.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255 12.6 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .256 12.7 power dissipation characteristics . . . . . . . . . . . . . . . . . . . . . 257 12.8 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .259 12.9 peripheral port timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263 12.10 analog-to-digital converter characteristics . . . . . . . . . . . . . .265 12.11 expansion bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 12.12 serial peripheral interface timing . . . . . . . . . . . . . . . . . . . . .269 12.13 eeprom characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .272 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 16 table of contents motorola table of contents section 13. mechanical data 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .273 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .273 13.3 84-pin plastic-leaded chip carrier (case 780) . . . . . . . . . . .275 13.4 84-pin j-cerquad (case 780a) . . . . . . . . . . . . . . . . . . . . . . .276 13.5 80-pin quad flat pack (case 841b) . . . . . . . . . . . . . . . . . . .277 13.6 80-pin low-profile quad flat pack (case 917a) . . . . . . . . . .278 13.7 68-pin plastic leaded chip carrier (case 779) . . . . . . . . . . .279 13.8 68-pin j-cerquad (case 779a) . . . . . . . . . . . . . . . . . . . . . . .280 s ec t i o n 14. o r d e r i n g i n f o r m at i o n s e c t i o n 1 5 . d ev e l o p m e n t s u pp o r t i nd e x f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola list of figures 17 technical data ? m68hc11k family list of figures figure title page 1-1 m68hc11k4 family block diagram . . . . . . . . . . . . . . . . . . . . . 29 1-2 m68hc11ks family block diagram. . . . . . . . . . . . . . . . . . . . . 30 2-1 pin assignments for m68hc11k 84-pin plcc/j-cerquad . . .32 2-2 pin assignments for m6811k 80-pin qfp . . . . . . . . . . . . . . . .33 2-3 pin assignments for m6811ks 68-pin plcc/j-cerquad . . . . .34 2-4 pin assignments for m6811ks 80-pin lqfp . . . . . . . . . . . . . .35 2-5 external reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2-6 common crystal connections . . . . . . . . . . . . . . . . . . . . . . . . .38 2-7 system configuration options 2 (opt2) . . . . . . . . . . . . . . . . .40 2-8 lir timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 2-9 modb/v stby connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 3-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3-2 stacking operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 4-1 register and control bit assignments . . . . . . . . . . . . . . . . . . .65 4-2 highest priority i-bit interrupt and miscellaneous register (hprio) . . . . . . . . . . . . . . . . .80 4-3 m68hc11k4 family memory map . . . . . . . . . . . . . . . . . . . . . .82 4-4 m68hc11ks2 family memory map . . . . . . . . . . . . . . . . . . . . .83 4-5 ram and i/o mapping register (init) . . . . . . . . . . . . . . . . . . .84 4-6 system configuration register (config) . . . . . . . . . . . . . . . . 88 4-7 eeprom mapping register (init2). . . . . . . . . . . . . . . . . . . . .89 4-8 eprom programming control register (eprog). . . . . . . . . .91 4-9 eeprom programming control register (pprog) . . . . . . . .94 4-10 block protect register (bprot) . . . . . . . . . . . . . . . . . . . . . . .96 4-11 system configuration options register (option) . . . . . . . . .97 4-12 block protect register (bprot) . . . . . . . . . . . . . . . . . . . . . .100 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 18 list of figures motorola list of figures figure title page 4-13 system configuration register (config) . . . . . . . . . . . . . . .101 4-14 system configuration register (config) . . . . . . . . . . . . . . .102 4-15 system configuration options 2 register (opt2) . . . . . . . . .103 5-1 system configuration register (config) . . . . . . . . . . . . . . .108 5-2 system configuration options register (option) . . . . . . . .109 5-3 arm/reset cop timer circuitry register (coprst). . . . . . .110 5-4 system configuration options register (option) . . . . . . . .111 5-5 system configuration options register 2 (opt2) . . . . . . . . .112 5-6 system configuration options register (option) . . . . . . . .121 5-7 highest priority i-bit interrupt and miscellaneous register (hprio) . . . . . . . . . . . . . . . .123 5-8 processing flow out of reset . . . . . . . . . . . . . . . . . . . . . . . .125 5-9 interrupt priority resolution . . . . . . . . . . . . . . . . . . . . . . . . . .127 5-10 interrupt priority resolution within sci system . . . . . . . . . . .129 5-11 system configuration options register (option) . . . . . . . .131 5-12 system configuration options 3 register (opt3) . . . . . . . . .132 5-13 slow mode example for m68hc(7)11ks devices only . . . . .133 6-1 port a data register (porta) . . . . . . . . . . . . . . . . . . . . . . . .138 6-2 port a data direction register (ddra) . . . . . . . . . . . . . . . . . 138 6-3 port b data register (portb) . . . . . . . . . . . . . . . . . . . . . . . .139 6-4 port b data direction register (ddrb) . . . . . . . . . . . . . . . . . 139 6-5 port c data register (portc). . . . . . . . . . . . . . . . . . . . . . . .140 6-6 port c data direction register (ddrc) . . . . . . . . . . . . . . . . .141 6-7 system configuration options 2 register (opt2) . . . . . . . . .141 6-8 port d data register (portd). . . . . . . . . . . . . . . . . . . . . . . .142 6-9 port d data direction register (ddrd) . . . . . . . . . . . . . . . . .142 6-10 port e data register (porte) . . . . . . . . . . . . . . . . . . . . . . . .143 6-11 port f data register (portf) . . . . . . . . . . . . . . . . . . . . . . . .144 6-12 port f data direction register (ddrf) . . . . . . . . . . . . . . . . . 144 6-13 port g data register (portg) . . . . . . . . . . . . . . . . . . . . . . .145 6-14 port g data direction register (ddrg) . . . . . . . . . . . . . . . . . 145 6-15 port h data register (porth). . . . . . . . . . . . . . . . . . . . . . . .146 6-16 port h data direction register (ddrh) . . . . . . . . . . . . . . . . .146 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures m68hc11k family technical data motorola list of figures 19 figure title page 6-17 port pullup assignment register (ppar). . . . . . . . . . . . . . . .147 6-18 system configuration register (config) . . . . . . . . . . . . . . .147 7-1 sci data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 7-2 sci transmitter block diagram . . . . . . . . . . . . . . . . . . . . . . .152 7-3 sci receiver block diagram . . . . . . . . . . . . . . . . . . . . . . . . . 155 7-4 sci baud generator circuit diagram . . . . . . . . . . . . . . . . . . .157 7-5 sci baud rate control register high (scbdh) . . . . . . . . . .158 7-6 sci baud rate control register low (scbdl) . . . . . . . . . . .158 7-7 sci control register 1 (sccr1) . . . . . . . . . . . . . . . . . . . . . . 160 7-8 sci control register 2 (sccr2) . . . . . . . . . . . . . . . . . . . . . . 161 7-9 sci status register 1 (scsr1) . . . . . . . . . . . . . . . . . . . . . . .162 7-10 sci status register 2 (scsr2) . . . . . . . . . . . . . . . . . . . . . . .164 7-11 sci data register (scdr) . . . . . . . . . . . . . . . . . . . . . . . . . . .165 8-1 spi block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169 8-2 data clock timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . .171 8-3 serial peripheral control register (spcr). . . . . . . . . . . . . . .174 8-4 serial peripheral status register (spsr) . . . . . . . . . . . . . . .176 8-5 serial peripheral data register (spdr). . . . . . . . . . . . . . . . .177 8-6 port d data direction register (ddrd) . . . . . . . . . . . . . . . . .178 8-7 system configuration options 2 register (opt2) . . . . . . . . .179 9-1 timer clock divider chains . . . . . . . . . . . . . . . . . . . . . . . . . . 183 9-2 capture/compare block diagram. . . . . . . . . . . . . . . . . . . . . .187 9-3 timer counter register (tcnt) . . . . . . . . . . . . . . . . . . . . . . .188 9-4 timer interrupt flag 2 (tflg2). . . . . . . . . . . . . . . . . . . . . . . .189 9-5 timer interrupt mask 2 (tmsk2) . . . . . . . . . . . . . . . . . . . . . .189 9-6 port a data direction register (ddra) . . . . . . . . . . . . . . . . . 190 9-7 pulse accumulator control register (pactl) . . . . . . . . . . . . 191 9-8 timer input capture registers (tic1?tic3). . . . . . . . . . . . . .192 9-9 timer input capture 4/output compare 5 register (ti4/o5) . . . . . . . . . . . . . . . . . . . . . .193 9-10 timer interrupt flag 1 register (tflg1) . . . . . . . . . . . . . . . .194 9-11 timer interrupt mask 1 register (tmsk1) . . . . . . . . . . . . . . .194 9-12 timer control 2 register (tctl2) . . . . . . . . . . . . . . . . . . . . .195 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 20 list of figures motorola list of figures figure title page 9-13 timer output compare registers (toc1 ? toc4) . . . . . . . . . . . . . . . . . . . . . . . . . .197 9-14 timer input capture 4/output compare 5 register (ti4/o5) . . . . . . . . . . . . . . . . . . . . . .199 9-15 timer interrupt flag 1 register (tflg1) . . . . . . . . . . . . . . . .199 9-16 timer interrupt mask 1 register (tmsk1) . . . . . . . . . . . . . . .200 9-17 timer control register 1 (tctl1) . . . . . . . . . . . . . . . . . . . . .200 9-18 timer compare force register (cforc) . . . . . . . . . . . . . . .201 9-19 output compare 1 mask register (oc1m) . . . . . . . . . . . . . .202 9-20 output compare 1 data register (oc1d) . . . . . . . . . . . . . . .202 9-21 pulse accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 9-22 port a data direction register (ddra) . . . . . . . . . . . . . . . . . 205 9-23 pulse accumulator control register (pactl) . . . . . . . . . . . .205 9-24 timer interrupt flag 2 (tflg2). . . . . . . . . . . . . . . . . . . . . . . .206 9-25 timer interrupt mask 2 (tmsk2) . . . . . . . . . . . . . . . . . . . . . .207 9-26 pulse accumulator count register (pacnt) . . . . . . . . . . . . .208 9-27 timer interrupt flag 2 register (tflg2) . . . . . . . . . . . . . . . .209 9-28 timer interrupt mask 2 register (tmsk2) . . . . . . . . . . . . . . .209 9-29 pulse accumulator control register (pactl) . . . . . . . . . . . .210 9-30 pulse-width modulation timer block diagram . . . . . . . . . . . .212 9-31 pulse-width modulation timer clock select (pwclk) . . . . .213 9-32 pulse-width modulation timer polarity register (pwpol) . . . . . . . . . . . . . . . . . . . . . . . .215 9-33 pulse-width modulation timer prescaler register (pwscal). . . . . . . . . . . . . . . . . . . . . .215 9-34 pulse-width modulation timer enable register (pwen) . . . . . . . . . . . . . . . . . . . . . . . . . .216 9-35 pulse-width modulation timer counters 1 to 4 (pwcnt1 to pwcnt4) . . . . . . . . . . . . . .217 9-36 pulse-width modulation timer periods 1 to 4 (pwper1 to pwper4) . . . . . . . . . . . . . . .218 9-37 pulse-width modulation timer duty cycle 1 to 4 (pwdty1 to pwdty4) . . . . . . . . . . . . . 219 10-1 a/d converter block diagram. . . . . . . . . . . . . . . . . . . . . . . . .222 10-2 a/d conversion sequence . . . . . . . . . . . . . . . . . . . . . . . . . . .224 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list of figures m68hc11k family technical data motorola list of figures 21 figure title page 10-3 system configuration options register (option) . . . . . . . .227 10-4 analog-to-digital control/status register (adctl) . . . . . . . .227 10-5 analog-to-digital result registers (adr1 ? adr4)) . . . . . . . .229 10-6 electrical model of an a/d input pin (sample mode) . . . . . . .230 11-1 port g assignment register (pgar) . . . . . . . . . . . . . . . . . . .235 11-2 memory mapping size register (mmsiz). . . . . . . . . . . . . . . .235 11-3 memory mapping window base register (mmwbr). . . . . . .236 11-4 memory mapping window control registers (mm1cr and mm2cr) . . . . . . . . . . . . . . . . . . .237 11-5 chip-select control register (csctl) . . . . . . . . . . . . . . . . . .240 11-6 chip-select control register (csctl) . . . . . . . . . . . . . . . . . .241 11-7 memory mapping size register (mmsiz). . . . . . . . . . . . . . . .243 11-8 general-purpose chip select 1 address register (gpcs1a) . . . . . . . . . . . . . . . . . . . . . . .243 11-9 general-purpose chip select 1 control register (gpcs1c). . . . . . . . . . . . . . . . . . . . . . . . 244 11-10 general-purpose chip select 2 address register (gpcs2a) . . . . . . . . . . . . . . . . . . . . . . .245 11-11 general-purpose chip select 2 control register (gpcs2c). . . . . . . . . . . . . . . . . . . . . . . . 245 11-12 general-purpose chip select 1 control register (gpcs1c). . . . . . . . . . . . . . . . . . . . . . . . 247 11-13 general-purpose chip select 2 control register (gpcs2c). . . . . . . . . . . . . . . . . . . . . . . . 247 11-14 chip select clock stretch register (cscstr) . . . . . . . . . . . 249 11-15 memory expansion example 1 ? memory map for a single 8-kbyte window with eight banks of external memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .250 11-16 memory expansion example 2 memory map for one 8-kbyte window with eight banks and one 16-kbyte window with 16 banks of external memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251 12-1 test methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258 12-2 timer inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .259 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 22 list of figures motorola list of figures figure title page 12-3 por external reset timing diagram . . . . . . . . . . . . . . . . . . .260 12-4 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . . .261 12-5 wait recovery from inerrupt timing diagram. . . . . . . . . . . .262 12-6 interrupt timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . .262 12-7 port read timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .264 12-8 port write timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .264 12-9 expansion bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268 12-10 spi timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .270 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola list of tables 23 technical data ? m68hc11k family list of tables table title page 1-1 m68hc11k family devices . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2-1 i/o ports and peripheral functions. . . . . . . . . . . . . . . . . . . . . .42 2-2 port signal summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 3-1 instruction set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 4-1 registers with limited write access. . . . . . . . . . . . . . . . . . . . .76 4-2 synchronization character selection . . . . . . . . . . . . . . . . . . . .79 4-3 hardware mode select summary. . . . . . . . . . . . . . . . . . . . . . .80 4-4 default memory map addresses . . . . . . . . . . . . . . . . . . . . . . .83 4-5 ram mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 4-6 register mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 4-7 eeprom map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 4-8 scope of eeprom erase. . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 4-9 eeprom block protect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4-10 xout frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 5-1 reset vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 5-2 cop timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 5-3 irvne operation after reset . . . . . . . . . . . . . . . . . . . . . . . . .113 5-4 xout clock divide select . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 5-5 interrupt and reset vector assignments . . . . . . . . . . . . . . . .118 5-6 stacking order on entry to interrupts . . . . . . . . . . . . . . . . . . .119 5-7 highest priority interrupt selection . . . . . . . . . . . . . . . . . . . . . 124 6-1 port configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 24 list of tables motorola list of tables table title page 7-1 sci receiver flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 7-2 sci+ baud rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159 8-1 spi+ baud rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .175 9-1 main timer rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184 9-2 timer prescale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190 9-3 input capture edge selection. . . . . . . . . . . . . . . . . . . . . . . . .195 9-4 timer output compare actions . . . . . . . . . . . . . . . . . . . . . . .201 9-5 pulse accumulator timing . . . . . . . . . . . . . . . . . . . . . . . . . . .203 9-6 pulse accumulator edge control . . . . . . . . . . . . . . . . . . . . . .206 9-7 real-time interrupt rate versus rtr[1:0] . . . . . . . . . . . . . . .210 9-8 clock a prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 9-9 clock b prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 10-1 a/d converter channel selection. . . . . . . . . . . . . . . . . . . . . .225 11-1 cpu address and address expansion signals . . . . . . . . . . .233 11-2 window size select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 11-3 memory expansion window base address . . . . . . . . . . . . . .236 11-4 chip select control parameter summary. . . . . . . . . . . . . . . .239 11-5 program chip select size. . . . . . . . . . . . . . . . . . . . . . . . . . . .240 11-6 general-purpose chip select 1 size control . . . . . . . . . . . . .244 11-7 general-purpose chip select 2 size control . . . . . . . . . . . . .246 11-8 one chip select driving another . . . . . . . . . . . . . . . . . . . . . .248 11-9 cscstr bits versus clock cycles . . . . . . . . . . . . . . . . . . . . 249 14-1 m68hc11k family devices . . . . . . . . . . . . . . . . . . . . . . . . . .281 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola general description 25 technical data ? m68hc11k family section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.3 m68hc11k family members . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.4 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.5 structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 1.2 introduction the m68hc11k family of high-performance microcontroller units (mcus) offers a non-multiplexed expanded bus, high speed and low power consumption. the fully static design allows operation at frequencies from dc to 4 mhz. this manual contains information concerning standard and custom-rom (read-only memory) devices. standard devices include those replacing the rom with:  disabled rom  disabled eeprom (electrically erasable, programmable read-only memory)  eprom (erasable, programmable read-only memory)  otprom (one-time progammable read-only memory) custom-rom devices have a rom array that is programmed at the factory to customer specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 26 general description motorola general description 1.3 m68hc11k family members m68hc11k family devices feature up to 62 input/output (i/o) lines distributed among eight ports, a through h. the ks family removes seven pins from port g and four pins from port h for a total of 51 i/o lines. the ksx versions feature a slow mode for the clocks to allow power conservation. table 1-1 lists devices currently available in the k family along with their distinguishing features. note: the ka2 and ka4 devices have been replaced by the pin-for-pin compatible ks2. table 1-1. m68hc11k family devices device number rom or eprom (bytes) (1) ram (bytes) eeprom (bytes) i/o (pins) chip select slow mode packages mc68hc(l)11k0 mc68hc(l)11k1 mc68hc(l)11k4 0 0 24 k 768 768 768 0 640 640 37 37 62 yes yes ye s no no no 84-pin plcc (2) 80-pin qfp (3) mc68hc711k4 24 k 768 640 62 yes no 84-pin j-cerquad (4) 84-pin plcc 80-pin qfp mc68hc11ks2 32 k 1 k 640 51 no yes 68-pin plcc and 80-pin lqfp (5) mc68hc711ks2 32 k 1 k 640 51 no yes 68-pin j-cerquad, 68-pin plcc, and 80-pin lqfp 1. where applicable, eprom bytes appear in italics. 2. plcc = plastic leaded chip carrier 3. qfp = quad flat pack 4. j-cerquad = ceramic windowed version of plcc 5. lqfp = low-profile quad flat pack f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description features m68hc11k family technical data motorola general description 27 1.4 features m68hc11k family features include:  8-bit opcodes and data  16-bit addressing  two 8-bit accumulators, which can be concatenated to form one 16-bit accumulator  on-board memory: ? 24 kbytes or 32 kbytes of rom, eprom, or otprom ? 768 bytes or 1 kbyte of static ram (random-access memory) ? 640 bytes of eeprom ? 128-byte register block  dual-function i/o lines ? any pins used for the microcontroller ? s peripheral functions can be configured as general-purpose i/o lines.  non-multiplexed address and data buses  68hc11k4 offers: ? 1 mbyte of address space, using on-chip memory mapping logic ? four programmable chip selects (expanded modes)  16-bit timer system: ? three input capture (ic) channels, record event timing by storing the value of the timing system ? s 16-bit free-running counter when an input signal transition occurs. ? four output compare (oc) channels, provide timed outputs by signaling when the free-running counter reaches a predetermined number. ? one ic or oc channel (software selectable)  8-bit pulse accumulator  four 8-bit pulse-width modulation (pwm) outputs  enhanced asynchronous serial communications interface (sci) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 28 general description motorola general description  enhanced synchronous serial peripheral interface (spi)  8-channel, 8-bit, analog-to-digital (a/d) converter  computer operating properly (cop) watchdog system to guard against infinite loops and other system problems  real-time interrupt timer  power-saving modes: ? slow mode reduces power consumption by slowing down internal operations. ? wait mode shuts down various system features selected by the user with power consumption typically dropping to 10 ? 100 mw. ? stop mode also shuts down system clocks, typically reducing power consumption to about 1.5 mw.  package availability for rom devices: ? k versions: 84-pin plastic leaded chip carrier (plcc) 80-pin quad flat pack (qfp) ? ks versions: 68-pin plastic leaded chip carrier (plcc) 80-pin low-profile quad flat pack (lqfp)  package availability for eprom devices: ? k versions: 80-pin quad flat pack (qfp) 84-pin j-cerquad (ceramic windowed version of plcc) 84-pin plastic leaded chip carrier (plcc) ? ks versions: 68-pin j-cerquad (ceramic windowed version of plcc) 80-pin low-profile quad flat pack (lqfp) 68-pin plastic leaded chip carrier (plcc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description structure m68hc11k family technical data motorola general description 29 1.5 structure figure 1-1 is a block diagram of the m68hc11k family mcu. figure 1-2 is a block diagram of the m68hc11ks devices. figure 1-1. m68hc11k4 family block diagram cpu pd5 pd4 pd3 pd2 pd1 pd0 port d ddrd sci spi sck mosi miso txd rxd port g mode control clock logic oscillator extal xtal e interrupt logic reset r/w ddrg port c ddrc port a pai/oc1 pulse accumulator cop periodic interrupt ddra data bus pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 port e a/d converter port h ddrh memory expansion 24 kbytes rom/eprom 768 bytes ram 640 bytes eeprom chip selects pwms xout (1) ddrf an7 an6 an5 an4 an3 an2 an1 an0 ss moda/ timer system modb/ v stby irq xirq /v pp (2) port f ddrb port b v rh v rl av dd av ss lir oc2/oc1 oc3/oc1 oc4/oc1 ic4/oc5/oc1 ic1 ic2 ic3 v dd v ss pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pg7 pg6 pg5 pg4 pg3 pg2 pg1 pg0 ph7 ph6 ph5 ph4 ph3 ph2 ph1 ph0 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 addr15 addr14 addr13 addr12 addr11 addr10 addr9 addr8 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 xa17 xa16 xa15 xa14 xa13 xa18 csprog csgp2 csgp1 csio pw4 pw3 pw2 pw1 address bus data7 data6 data5 data4 data3 data2 data1 data0 1. xout pin omitted on 80-pin qfp 2. v pp applies only to eprom devices. notes: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 30 general description motorola general description figure 1-2. m68hc11ks family block diagram ic1 ic2 ic3 cpu pd5 pd4 pd3 pd2 pd1 pd0 port d ddrd sci spi sck mosi miso txd rxd port g mode control clock logic oscillator extal xtal e interrupt logic reset r/w ddrg port c ddrc port a pai/oc1 pulse accumulator cop periodic interrupt ddra data bus pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 port e a/d converter port h ddrh mc68hc11ks2 640 bytes eeprom pwms xout ddrf an7 an6 an5 an4 an3 an2 an1 an0 ss moda/ timer system modb/ v stby irq xirq /v pp (2) port f ddrb port b v rh v rl av dd av ss lir oc2/oc1 oc3/oc1 oc4/oc1 ic4/oc5/oc1 v dd v ss pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pg7 ph3 ph2 ph1 ph0 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 addr15 addr14 addr13 addr12 addr11 addr10 addr9 addr8 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 pw4 pw3 pw2 pw1 address bus data7 data6 data5 data4 data3 data2 data1 data0 notes: 32 kbytes rom/eprom mc68hc11ks2 1 kbytes ram with slow mode 1. the configuration shown in this diagram is the mc68hc11ks2. 2. v pp applies only to eprom devices. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola pin description 31 technical data ? m68hc11k family section 2. pin description 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.3 power supply (v dd , v ss , av dd , and av ss ). . . . . . . . . . . . . . .36 2.4 reset (reset ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.5 crystal driver and external clock input (xtal and extal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 2.6 xout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.7 e-clock output (e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.8 interrupt request (irq) and non-maskable interrupt (xirq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.9 mode selection, instruction cycle reference, and standby power (moda/lir and modb/v stby ) . . . . . .39 2.10 v rh and v rl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.11 port signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 2.2 introduction the m68hc11k family is available in a variety of packages, as shown in table 1-1. m68hc11k family devices . most pins on this mcu serve two or more functions, as described in this section. pin assignments for the various package types are shown in figure 2-1 , figure 2-2 , figure 2-3 , and figure 2-4 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 32 pin description motorola pin description figure 2-1. pin assignments for m68hc11k 84-pin plcc/j-cerquad pd2/miso 74 pd1/t x d 73 pd0/r x d 72 moda/lir 71 modb/v stby 70 reset 69 xtal 68 extal 67 xout 66 e 65 v dd 64 v ss 63 pc7/data7 62 pc6/data6 61 pc5/data5 60 pc4/data4 59 pc3/data3 58 pc2/data2 57 pc1/data1 56 pc0/data0 55 irq 54 pb0/addr8 11 pb1addr9 10 pb2/addr10 9 pb3/addr11 8 pb4/addr12 7 pb5/addr13 6 pb6/addr14 5 pb7/addr15 4 v ss 3 v dd 2 pa0/ic3 1 pa1/ic2 84 pa2/ic1 83 pa3/ic4/oc5/oc1 82 pa4/oc4/oc1 81 pa5/oc3/oc1 80 pa6/oc2/oc1 79 pa7/pai/oc1 78 pd5/ss 77 pd4/sck 76 pd3/mosi 75 ph0/pw1 ph1/pw2 ph2/pw3 ph3/pw4 ph4/csio ph5/csgp1 ph6/csgp2 ph7/csprog test16 (1) xirq /v pp (2) v dd v ss test14 (1) pg7/r/w pg6 pg5/xa18 pg4/xa17 pg3/xa16 pg2/xa15 pg1/xa14 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 32 pg0/xa13 av dd pe7/an7 pe6/an6 pe5/an5 pe4/an4 pe3/an3 pe2/an2 pe1/an1 pe0/an0 v rl v rh 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 30 pf7/addr7 pf6/addr6 pf5/addr5 pf4/addr4 pf3/addr3 pf2/addr2 pf1/addr1 pf0/addr0 av ss test15 (1) 1. pins 20, 22, and 25 are used only during factory testing and should not be connected to external circuitry. 2. v pp applies only to eprom devices. notes: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description introduction m68hc11k family technical data motorola pin description 33 figure 2-2. pin assignments for m6811k 80-pin qfp pf0/addr0 60 pf1/addr1 59 pf2/addr2 58 pf3/addr3 57 pf4/addr4 56 pf5/addr5 55 pf6/addr6 54 pf7/addr7 53 av ss 52 v rh 51 v rl 50 pe0/an0 49 pe1/an1 48 pe2/an2 47 pe3/an3 46 pe4/an4 45 pe5/an5 44 pe6/an6 43 pe7/an7 42 av dd 41 pd2/miso 80 pd1/txd 79 pd0/rxd 78 moda/lir 77 modb/v stby 76 reset 75 xtal 74 extal 73 e 72 v dd 71 v ss 70 pc7/data7 69 pc6/data6 68 pc5/data5 67 pc4/data4 66 pc3/data3 65 pc2/data2 64 pc1/data1 63 pc0/data0 62 irq 61 pd3/mosi 1 pd4/sck 2 pd5/ss 3 pa7/pai/oc1 4 pa6/oc2/oc1 5 pa5/oc3/oc1 6 pa4/oc4/oc1 7 pa3/ic4/oc5/oc1 8 pa2/ic1 9 pa1/ic2 10 pa0/ic3 11 v dd 12 v ss 13 pb7/addr15 14 pb6/addr14 15 pb5/addr13 16 pb4/addr12 17 pb3/addr11 18 pb2/addr10 19 pb1/addr9 20 pb0/addr8 21 ph0/pw1 22 ph1/pw2 23 ph2/pw3 24 ph3/pw4 25 ph4/csio 26 ph5/csgp1 27 ph6/csgp2 28 ph7/csprog 29 xirq /v pp * 30 v dd 31 v ss 32 pg7/r/w 33 pg6 34 pg5/xa18 35 pg4/xa17 36 pg3/xa16 37 pg2/xa15 38 pg1/xa14 39 pg0/xa13 40 * v pp applies only to eprom devices. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 34 pin description motorola pin description figure 2-3. pin assignments for m6811ks 68-pin plcc/j-cerquad moda/lir 60 modb/v stby 59 reset 58 xtal 57 extal 56 xout 55 e 54 pc7/data7 53 pc6/data6 52 pc5/data5 51 pc4/data4 50 pc3/data3 49 pc2/data2 48 pc1/data1 47 pc0/data0 46 pf0/addr0 45 pf1/addr1 44 pa0/ic3 9 pa1/ic2 8 pa2/ic1 7 pa3/ic4/oc5/oc1 6 pa4/oc4/oc1 5 pa5/oc3/oc1 4 pa6/oc2/oc1 3 pa7/pai/oc1 2 v dd 1 v dd 68 v ss 67 pd5/ss 66 pd4/sck 65 pd3/mosi 64 pd2/miso 63 pd1/txd 62 pd0/rxd 61 pb7/addr15 pb6/addr14 pb5/addr13 pb4/addr12 pb3/addr11 pb2/addr10 pb1/addr9 pb0/addr8 ph1/pw2 ph2/pw3 ph3/pw4 xirq /v pp * pg7/r/w irq av dd pe7/an7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe6/an6 pe5/an5 pe4/an4 pe3/an3 pe2/an2 pe1/an1 pe0/an0 v rl v rh av ss 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 26 pf7/addr7 pf6/addr6 pf5/addr5 pf4/addr4 pf3/addr3 pf2/addr2 v ss ph0/pw1 * v pp applies only to eprom devices. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description introduction m68hc11k family technical data motorola pin description 35 figure 2-4. pin assignments for m6811ks 80-pin lqfp pf2/addr2 60 pf3/addr3 59 pf4/addr4 58 pf5/addr5 57 pf6/addr6 56 pf7/addr7 55 v ss 54 av ss 53 v rh 52 nc 51 v rl 50 nc 49 pe0/an0 48 pe1/an1 47 pe2/an2 46 pe3/an3 45 pe4/an4 44 pe5/an5 43 pe6/an6 42 nc 41 nc 80 nc 79 moda/lir 78 modb/v stby 77 reset 76 xtal 75 extal 74 xout 73 e 72 nc 71 pc7/data7 70 pc6/data6 69 pc5/data5 68 pc4/data4 67 pc3/data3 66 pc2/data2 65 pc1/data1 64 pc0/data0 63 pf0/addr0 62 pf1/addr1 61 pd0/rxd 1 pd1/txd 2 pd2/miso 3 pd3/mosi 4 pd4/sck 5 pd5/ss 6 nc 7 v ss 8 nc 9 v dd 10 nc 11 v dd 12 pa7/pai/oc1 13 pa6/oc2/oc1 14 pa5/oc3/oc1 15 pa4/oc4/oc1 16 pa3/ic4/oc5/oc1 17 pa2/ic1 18 pa1/ic2 19 pa0/ic3 20 pb7/addr15 21 pb6/addr14 22 pb5/addr13 23 pb4/addr12 24 pb3/addr11 25 pb2/addr10 26 pb1/addr9 27 pb0/addr8 28 ph0/pw1 29 ph1/pw2 30 ph2/pw3 31 ph3/pw4 32 xirq /v pp *33 nc 34 nc 35 pg7/r/w 36 irq 37 av dd 38 pe7/an7 39 nc 40 * v pp applies only to eprom devices. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 36 pin description motorola pin description 2.3 power supply (v dd , v ss , av dd , and av ss ) the mcu operates from a single 5-volt (nominal) power supply. v dd is the positive power input and v ss is ground. there are three v dd /v ss pairs of pins on the k series devices and two sets on the ks devices. all devices contain a separate pair of power inputs, av dd and av ss , for the analog-to-digital (a/d) converter, so that the a/d circuitry can be bypassed independently. very fast signal transitions occur on the mcu pins. the short rise and fall times place high, short duration current demands on the power supply. to prevent noise problems, provide good power supply bypassing at the mcu. also, use bypass capacitors that have good high-frequency characteristics and situate them as close to the mcu as possible. bypass requirements vary, depending on how heavily the mcu pins are loaded. 2.4 reset (reset ) this active-low, bidirectional control signal acts as an input to initialize the mcu to a known start-up state. it also serves as an open-drain output to indicate that an internal failure has been detected in either the clock monitor or computer operating properly (cop) watchdog circuit. the cpu distinguishes between internal and external reset conditions by counting the number of e-clock cycles that occur between the start of reset and the presence of a logic 1 voltage level on the reset pin. less than two cycles indicates an internal reset; greater than two, an external reset. to prevent the device from misinterpreting the kind of reset that occurs, do not connect an external resistor-capacitor (rc) power-up delay circuit directly to the reset pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description crystal driver and external clock input (xtal and extal) m68hc11k family technical data motorola pin description 37 figure 2-5. external reset circuit it is important to protect the mcu against corruption of ram and eeprom during power transitions. this can be done with a low-voltage interrupt (lvi) circuit which holds the reset pin low when v dd drops below the minimum operating level. figure 2-5 shows a suggested reset circuit that incorporates two lvi devices and an external switch. 2.5 crystal driver and external clock input (xtal and extal) these two pins provide the interface for either a crystal or a cmos-compatible clock to control the internal clock generator circuitry. the frequency applied to these pins is four times higher than the desired e-clock rate. when an external cmos-compatible clock input is connected to the extal pin, the xtal pin must be left unterminated. caution: in all cases, use caution around the oscillator pins. load capacitances shown in figure 2-6 are specified by the crystal manufacturer and should include all stray layout capacitances. to reset v dd mc34064 reset gnd in of m68hc11 reset gnd in manual reset switch 4.7 k ? 1.0 ? mc34164 optional power-on delay and manual reset switch v dd v dd 4.7 k ? ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 38 pin description motorola pin description figure 2-6. common crystal connections 2.6 xout the xout pin provides a buffered clock signal if enabled to synchronize external devices with the mcu. see 4.9 xout pin control . note: this signal is not present on the 80-pin m68hc(7)11k device qfp package. 2.7 e-clock output (e) the internally generated instruction cycle clock, or e clock, is available on the e pin as a timing reference. its frequency is one fourth the input frequency at the xtal and extal pins. the e clock is low during the address portion of a bus cycle and high during the data access portion of the bus cycle. all clocks, including the e clock, are halted when the mcu is in stop mode. the e-pin driver can be turned off in single-chip modes to reduce radio frequency interference (rfi) and current consumption. 2.8 interrupt request (irq ) and non-maskable interrupt (xirq ) the mcu provides two pins for applying asynchronous interrupt requests. interrupts applied to the irq pin can be masked by setting the i bit in the condition code register (ccr), which can be set or cleared by software at any time. triggering is level sensitive by default, which is 10 m ? mcu c l * c l * extal xtal 4 x e crystal * this value includes all stray capacitances. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description mode selection, instruction cycle reference, and standby power (moda/lir and modb/vstby) m68hc11k family technical data motorola pin description 39 required for wire-or configuration. software can change the triggering to edge sensitive. xirq interrupts can be non-maskable after reset initialization. out of reset, the x bit in the ccr is set, masking xirq interrupts. once software clears the x bit, it cannot be reset, and the xirq interrupts become non-maskable. the xirq input is level sensitive only. xirq is often used as a power-loss detect interrupt. whenever irq or xirq is used with multiple interrupt sources, each source must drive the interrupt input with an open-drain type of driver to avoid contention between outputs. there should be a single pullup resistor near the mcu interrupt pin (typically 4.7 k ? caution: ensure that the voltage level at this pin is equal to v dd during normal operation to avoid programming accidents. 2.9 mode selection, instruction cycle reference, and standby power (moda/lir and modb/v stby ) during reset, moda and modb select one of four operating modes: 1. single-chip 2. expanded 3. bootstrap 4. special test for full descriptions of these modes, refer to 4.5 operating modes . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 40 pin description motorola pin description in single-chip and bootstrap modes, the moda pin typically is grounded and has no function after reset. in expanded and special test modes, moda is normally connected to v dd through a 4.7-k ? ? lir driven bit 0 = lir not driven high 1 = lir driven high for one quarter cycle to reduce transition time figure 2-8. lir timing address: $0038 bit 7654321bit 0 read: lirdv cwom strch (1) irvne lsbf spr2 xdv1 xdv0 write: reset:000?0000 1. strch is not available on k devices. figure 2-7. system configuration options 2 (opt2) e lir last cycle of first cycle of new opcode fetch note: if lirdv is not set, the pullup resistor may not return the level to a logic 1 before instruction previous instruction the next data fetch. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description vrh and vrl m68hc11k family technical data motorola pin description 41 the modb pin is grounded to select special modes, and has no function after reset. to select the normal operating modes (single-chip and expanded) the modb pin is pulled to a logic high level. connecting modb to a voltage source other than v dd enables it to function as a battery backup input, v stby. when v dd drops more than one mos threshold (about 0.7 volts) below the voltage at v stby , the mcu ? s ram and part of the reset logic are powered from v stby rather than v dd . reset must be driven low before v dd is removed and must remain low until v dd has been restored to a valid level. the extra hardware required to utilize v stby may be justified in certain applications where a significant amount of external circuitry operates from v dd . figure 2-9 shows a suggested circuit employing the v stby pin. figure 2-9. modb/v stby connection 2.10 v rh and v rl these pins provide the reference voltage for the analog-to-digital converter. 2.11 port signals the k series contains 62 input/output lines arranged in eight ports, a through h; all ports are eight bits except port d, which is six bits. the ks series drops seven lines from port g and four from port h, for a total of 4.7 k max 690 v batt + 4.8 v nicd v dd v dd v out to modb/v stby of m68hc11 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 42 pin description motorola pin description 51 i/o lines. all ports are fully bidirectional except port e, which is input only. each port can serve as either general-purpose i/o or as part of the microcontroller ? s specialized functions, depending on the operating mode or peripheral functions selected. the functions of ports b, c, and f and port g bit 7 depend on the operating mode. they serve as general-purpose i/o lines in single-chip and bootstrap modes and provide the address and data buses in expanded and special test modes. the other ports serve as general-purpose i/o out of reset; writes to control registers enable their special functions. section 6. parallel input/output describes general-purpose i/o operation in detail. table 2-1 summarizes the ports and references for peripheral functions. table 2-2 summarizes the port signals. table 2-1. i/o ports and peripheral functions i/o port special function(s) enabled by refer to port a timer and pulse accumulator control registers section 9. timing system port b high-order address bus expanded operating modes section 4. operating modes and on-chip memory port c data bus expanded operating modes section 4. operating modes and on-chip memory port d serial communication interface and serial peripheral interface control registers section 7. serial communications interface (sci) and section 8. serial peripheral interface (spi) port e a/d converter control registers section 10. analog-to-digital (a/d) converter port f low-order address bus expanded operating modes section 4. operating modes and on-chip memory port g bit 7 bits 6 ? 0 (1) r/w line and expansion address lines expanded operating modes and control registers (2) section 4. operating modes and on-chip memory and section 11. memory expansion and chip selects port h bits 7 ? 4 (1) bits 3 ? 0 chip-select lines and pulse-width modulator control registers section 9. timing system and section 11. memory expansion and chip selects 1. not available on ks devices 2. control registers can enable these functions only in expanded operating modes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pin description port signals m68hc11k family technical data motorola pin description 43 table 2-2. port signal summary port/bit single-chip and bootstrap modes expanded and special test modes pa0 pa0/ic3 pa1 pa1/ic2 pa2 pa2/ic1 pa3 pa3/oc5/ic4/and-or oc1 pa4 pa4/oc4/and-or oc1 pa5 pa5/oc3/and-or oc1 pa6 pa6/oc2/and-or oc1 pa7 pa7/pai/and-or oc1 pb[7:0] pb[7:0] addr[15:8] pc[7:0] pc[7:0] data[7:0] pd0 pd0/rxd pd1 pd1/txd pd2 pd2/miso pd3 pd3/mosi pd4 pd4/sck pd5 pd5/ss pe[7:0] pe[7:0]/an[7:0] pf[7:0] pf[7:0] addr[7:0] pg0 pg0 pg0/xa13 pg1 pg1 pg1/xa14 pg2 pg2 pg2/xa15 pg3 pg3 pg3/xa16 pg4 pg4 pg4/xa17 pg5 pg5 pg5/xa18 pg6 pg6 pg6 pg7 pg7 pg7/r/w ph0 ph0/pw1 ph1 ph1/pw2 ph2 ph2/pw3 ph3 ph3/pw4 ph4 ph4 ph4/csio ph5 ph5 ph5/csgp1 ph6 ph6 ph6/csgp2 ph7 ph7 ph7/csprog f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 44 pin description motorola pin description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola central processor unit (cpu) 45 technical data ? m68hc11k family section 3. central processor unit (cpu) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.3.1 accumulators a, b, and d (acca, accb, and accd) . . . . 47 3.3.2 index register x (ix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.3 index register y (iy) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.3.5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . 50 3.3.6.1 carry/borrow (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6.2 overflow (v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.3.6.3 zero (z) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.3.6.4 negative (n) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.5 interrupt mask (i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.6 half carry (h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 3.3.6.7 non-maskable interrupt (x) . . . . . . . . . . . . . . . . . . . . . . .52 3.3.6.8 stop disable (s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 3.4 data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 3.5 opcodes and operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 3.6 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 3.6.1 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.2 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.6.3 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.4 indexed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 3.6.5 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 3.6.6 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 3.7 instruction set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 46 central processor unit (cpu) motorola central processor unit (cpu) 3.2 introduction this section presents information on m68hc11 central processor unit (cpu) architecture, data types, addressing modes, the instruction set, and special operations, such as subroutine calls and interrupts. the cpu employs memory-mapped input/output (i/o). there are no special instructions for i/o; all peripheral, i/o, and memory locations are simply addresses in the 64-kbyte memory map. this architecture also enables access to operands from external memory locations with no execution time penalty. 3.3 cpu registers m68hc11 cpu registers are an integral part of the cpu and are not addressed as memory locations. the seven registers are shown in figure 3-1 . figure 3-1. programming model 8-bit accumulators a & b 70 70 15 0 ab d ix iy sp pc 70 c v z n i h x s or 16-bit double accumulator d index register x index register y stack pointer program counter carry/borrow from msb overflow zero negative i-interrupt mask half carry (from bit 3) x-interrupt mask stop disable condition codes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers m68hc11k family technical data motorola central processor unit (cpu) 47 3.3.1 accumulators a, b, and d (acca, accb, and accd) accumulators a and b are general-purpose 8-bit registers that hold operands and results of arithmetic calculations or data manipulations. some instructions treat these two accumulators as a single double-byte (16-bit) accumulator called accumulator d. most operations can use either accumulator a or b, with these exceptions:  the abx and aby instructions add the contents of 8-bit accumulator b to the contents of 16-bit register x or y, but there are no equivalent instructions that use a instead of b.  the tap and tpa instructions transfer data from accumulator a to the condition code register or from the condition code register to accumulator a. however, there are no equivalent instructions that use b rather than a.  the daa instruction adjusts accumulator a after binary-coded decimal (bcd) arithmetic operations, but there is no equivalent bcd instruction to adjust accumulator b.  the add, subtract, and compare instructions associated with both a and b (aba, sba, and cba) only operate in one direction, making planning ahead important to ensure the correct operand is in the correct accumulator. 3.3.2 index register x (ix) the ix register provides a 16-bit indexing value that can be added to the 8-bit offset provided in an instruction to create an effective address. the ix register can be used also as a counter or as a temporary storage register. 3.3.3 index register y (iy) the iy register provides a 16-bit indexed mode function similar to that of the ix register. instructions using the iy register require an extra byte of machine code and an extra cycle of execution time because of the way the opcode map is implemented. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 48 central processor unit (cpu) motorola central processor unit (cpu) 3.3.4 stack pointer (sp) the stack pointer holds the 16-bit address of the next free location in the m68hc11 cpu ? s automatic program stack. this stack is a data structure that grows downward from high memory to low memory. the stack can be located anywhere in the address space and can be any size up to the amount of memory available in the system. most application programs initialize the sp at the beginning of an application program with a load stack (lds) instruction. thereafter, each time the cpu pushes a new byte onto the stack, it decrements the sp. to pull a byte from the stack, the cpu first increments the sp. figure 3-2 is a summary of sp operations. a jump-to-subroutine (jsr) or branch-to-subroutine (bsr) instruction pushes the address of the instruction immediately after the jsr or bsr onto the stack, least significant byte first. the last instruction of the subroutine is a return-from-subroutine (rts), which pulls the previously stored return address from the stack and loads it into the program counter. execution then continues at this recovered return address. when the processor recognizes an interrupt, it finishes the current instruction, pushes the return address (the current value in the program counter) onto the stack, pushes all of the cpu registers onto the stack, and continues at the address specified by the vector for the interrupt. the interrupt service routine ends with a return-from-interrupt (rti) instruction, which pulls the saved registers off the stack in reverse order. program execution resumes at the return address with all register contents restored. there are instructions that push and pull the a and b accumulators and the x and y index registers to preserve program context. for example, push accumulator a onto the stack when entering a subroutine that uses accumulator a, and pull accumulator a off the stack just before leaving the subroutine, to ensure that the contents of that register will be the same after returning from the subroutine as it was before starting the subroutine. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers m68hc11k family technical data motorola central processor unit (cpu) 49 figure 3-2. stacking operations ? sp ? 2 stack rtn h sp ? 1 rtn l sp 70 pc main program $9d = jsr jsr, jump to subroutine dd next main instr. rtn direct pc main program $ad = jsr ff next main instr. rtn indexed, x pc main program $18 = pre ff next main instr. rtn indexed, y $ad = jsr pc main program $bd = pre ll next main instr. rtn indexed, y hh sp stack ccr sp+1 accb sp+2 acca sp+3 ix h sp+4 ix l sp+5 iy h sp+6 iy l sp+7 rtn h sp+8 ? sp+9 70 rtn l pc interrupt routine $3b = rti ? sp ? 9 stack ccr sp ? 8 accb sp ? 7 acca sp ? 6 ix h sp ? 5 ix l sp ? 4 iy h sp ? 3 iy l sp ? 2 rtn h sp ? 1 sp 70 rtn l pc main program $3f = swi pc main program $3e = wai swi, software interrupt wai, wait for interrupt rti, return from interrupt ? sp ? 2 stack rtn h sp ? 1 rtn l sp 70 pc main program $8d = bsr pc main program $39 = rts bsr, branch to subroutine rts, return from subroutine sp stack rtn h sp+1 rtn l ? sp+2 70 legend: rtn = address of next instruction in main program to be executed upon return from subroutine rtn h = most significant byte of return address rtn l = least significant byte of return address ? = stack pointer position after operation is complete dd = 8-bit direct address ($0000 ? $00ff) (high byte assumed to be $00) ff = 8-bit positive offset $00 (0) to $ff (255) is added to index hh = high-order byte of 16-bit extended address ll = low-order byte of 16-bit extended address rr= signed relative offset $80 ( ? 128) to $7f (+127) (offset relative to the address following the machine code offset byte) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 50 central processor unit (cpu) motorola central processor unit (cpu) 3.3.5 program counter (pc) the 16-bit program counter contains the address of the next instruction to be executed. its initial value after reset is fetched from one of six possible vectors, depending on operating mode and the cause of reset, as described in 5.3 sources of resets . 3.3.6 condition code register (ccr) this 8-bit register contains:  five condition code indicators (c, v, z, n, and h)  two interrupt masking bits (irq and xirq)  a stop disable bit (s) most instructions update condition codes automatically, as described in the following paragraphs. certain instructions, such as pushes, pulls, add b to x (abx), add b to y (aby), and transfer/exchange instructions do not affect the condition codes. table 3-1 shows which condition codes are affected by each instruction. 3.3.6.1 carry/borrow (c) the c bit is set if the cpu performs a carry or borrow during an arithmetic operation. this bit also acts as an error flag for multiply and divide operations. shift and rotate instructions operate with and through the carry bit to facilitate multiple-word shift operations. 3.3.6.2 overflow (v) the overflow bit is set if an operation results in a two ? s complement overflow of the 8-bit signed range ? 128 to +127. otherwise, the v bit is cleared. 3.3.6.3 zero (z) the z bit is set if the result of an arithmetic, logic, or data manipulation operation is 0. otherwise, the z bit is cleared. compare instructions do f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers m68hc11k family technical data motorola central processor unit (cpu) 51 an internal implied subtraction and the condition codes, including z, reflect the results of that subtraction. a few operations (inx, dex, iny, and dey) affect the z bit and no other condition flags. 3.3.6.4 negative (n) the n bit is set if the result of an arithmetic, logic, or data manipulation operation is negative, meaning that the most significant bit (msb) of the result is a 1. otherwise, the n bit is cleared. to determine quickly if the msb of a particular byte is set, load it into an accumulator and then check the status of the n bit. 3.3.6.5 interrupt mask (i) when the interrupt mask bit is set, it disables all maskable interrupt requests (irqs). the cpu continues to operate uninterrupted while interrupts remain pending until the i bit is cleared. every reset sets the i bit by default and only a software instruction can clear it. when the processor recognizes an interrupt, it stacks the registers, sets the i bit, and then fetches the interrupt vector. the final instruction of an interrupt service routine is usually a return from interrupt (rti), which restores the registers to the values that were present before the interrupt occurred and clears the i bit. note: although the i bit can be cleared earlier in the interrupt service routine, avoid nesting interrupts in this way without a clear understanding of latency and of the arbitration mechanism. refer to section 5. resets and interrupts . 3.3.6.6 half carry (h) the h bit is set when a carry occurs between bits 3 and 4 of the arithmetic logic unit during an add, aba, or adc instruction. otherwise, the h bit is cleared. half carry is used during binary-coded decimal (bcd) operations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 52 central processor unit (cpu) motorola central processor unit (cpu) 3.3.6.7 non-maskable interrupt (x) setting the xirq mask (x) bit disables non-maskable interrupts from the xirq pin. every reset sets the x bit by default and only a software instruction can clear it. when the processor recognizes a non-maskable interrupt, it stacks the registers, sets the x and i bits, and then fetches the interrupt vector. an interrupt service routine usually ends with a return from interrupt (rti), which restores the registers to the values that were present before the interrupt occurred and clears the x bit. only hardware or an acknowledge can set the x bit. only software can clear the x bit (for example, the tap instruction which transfers data from accumulator a to the condition code register). there is no hardware action for clearing x. 3.3.6.8 stop disable (s) setting the stop disable (s) bit prevents the stop instruction from putting the m68hc11 into a low-power stop condition. if the s bit is set, the cpu treats a stop instruction as if it were a no-operation (nop) instruction and continues to the next instruction. note: s is set by reset and stop is disabled by default. the stop instruction can be cleared by using the tap instruction which transfers data from accumulator a to the condition code register. 3.4 data types the mc68hc11 cpu supports these data types:  bit data  8-bit and 16-bit signed and unsigned integers  16-bit unsigned fractions  16-bit addresses a byte is eight bits wide and can be accessed at any byte location. a word is composed of two consecutive bytes with the most significant byte at the lower value address. because the m68hc11 is an 8-bit cpu, f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) opcodes and operands m68hc11k family technical data motorola central processor unit (cpu) 53 there are no special requirements for alignment of instructions or operands. 3.5 opcodes and operands the m68hc11 family of microcontrollers uses 8-bit opcodes. every instruction requires a unique opcode for each of its addressing modes. the resulting number of opcodes exceeds the 256 available in an 8-bit binary number. a 4-page opcode map has been implemented to accommodate the extra instructions. an additional byte, called a prebyte, directs the processor from page 0 of the opcode map to one of the other three pages. as its name implies, the additional byte precedes the opcode. a complete instruction consists of a prebyte, if any, an opcode, and zero to three operands. the operands contain information the cpu needs for executing the instruction. complete instructions can be from one to five bytes long. 3.6 addressing modes six addressing modes can be used to access memory: 1. immediate 2. direct 3. extended 4. indexed 5. inherent 6. relative all modes except inherent mode use an effective address. the effective address is the memory address where the argument is fetched or stored or the address from which execution is to proceed. the effective address can be specified within an instruction or it can be calculated. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 54 central processor unit (cpu) motorola central processor unit (cpu) 3.6.1 immediate in the immediate addressing mode, the byte(s) immediately following the opcode contain the arguments. the number of bytes following the opcode matches the size of the register or memory location being used. immediate instructions can be two, three, or (if a prebyte is required) four bytes. 3.6.2 direct in the direct addressing mode, the user specifies only the low-order byte of the effective address in a single byte following the opcode. the processor assumes the high-order byte of the address to be $00. thus, the cpu accesses addresses $00 ? $ff directly, using 2-byte instructions. this reduces execution time by eliminating the additional memory access required for the high-order address byte. most applications reserve this 256-byte area for frequently referenced data, but various combinations of internal registers, ram, or external memory can occupy these addresses. 3.6.3 extended in the extended addressing mode, the two bytes following the opcode byte contain the effective address of the argument. for this reason, instructions are three bytes, or they are four bytes if a prebyte is required. 3.6.4 indexed in the indexed addressing mode, the cpu computes the effective address of the argument by adding an 8-bit unsigned offset to the value contained in an index register (ix or iy). any memory location in the 64-kbyte address space can be accessed with this mode. the instructions are from two to five bytes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) instruction set m68hc11k family technical data motorola central processor unit (cpu) 55 3.6.5 inherent in the inherent addressing mode, the opcode contains all required information. the operands (if any) are registers, so no memory access is required. this mode includes:  control instructions with no arguments  operations that only involve the index registers or accumulators these instructions are one or two bytes. 3.6.6 relative only branch instructions use the relative addressing mode. if the branch condition is true, the cpu adds the 8-bit signed offset following the opcode to the contents of the program counter to form the effective branch address. otherwise, control proceeds to the next instruction. these are usually 2-byte instructions. 3.7 instruction set table 3-1 presents a detailed listing of all the m68hc11 instructions in all possible addressing modes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 56 central processor unit (cpu) motorola central processor unit (cpu) table 3-1. instruction set (sheet 1 of 7) mnemonic operation description addressing instruction condition codes mode opcode operand cycles s x h i n z v c aba add accumulators a + b ? ? 2 ?? ? ? ???? ? ? 3 ???????? aby add b to y iy + (00 : b) ? ? 4 ???????? adca (opr) add with carry to a a + m + c ? ?? ? ? ???? ? ?? ? ? ???? ? ?? ? ? ???? ? ?? ? ? ???? ? ???? ????  m ? ???? ?? ? andb (opr) and b with memory b  m ? ???? ?? ? asl (opr) arithmetic shift left ext ind,x ind,y 78 68 18 68 hh ll ff ff 6 6 7 ???? ???? ? 2 ???? ???? ? 2 ???? ???? ? 3 ???? ???? ???? ???? ? 2 ???? ???? ? 2 ???? ???? ???????? bclr (opr) (msk) clear bit(s) m  (mm ) ? ???? ?? ? bcs (rel) branch if carry set ? c = 1 rel 25 rr 3 ???????? c 0 b7 b0 c 0 b7 b0 c 0 b7 b0 c 0 b7 b0 a b b7 b0 c b7 b0 c b7 b0 c b7 b0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) instruction set m68hc11k family technical data motorola central processor unit (cpu) 57 beq (rel) branch if = zero ? z = 1 rel 27 rr 3 ???????? bge (rel) branch if ? ???????? bgt (rel) branch if > zero ? z + (n ???????? bhi (rel) branch if higher ? c + z = 0 rel 22 rr 3 ???????? bhs (rel) branch if higher or same ? c = 0 rel 24 rr 3 ???????? bita (opr) bit(s) test a with memory a  m a imm adir aext a ind,x a ind,y 85 95 b5 a5 18 a5 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? ? bitb (opr) bit(s) test b with memory b  m b imm bdir bext b ind,x b ind,y c5 d5 f5 e5 18 e5 ii dd hh ll ff ff 2 3 4 4 5 ???? ?? ? ble (rel) branch if ? ???????? blo (rel) branch if lower ? c = 1 rel 25 rr 3 ???????? bls (rel) branch if lower or same ? c + z = 1 rel 23 rr 3 ???????? blt (rel) branch if < zero ? n ???????? bmi (rel) branch if minus ? n = 1 rel 2b rr 3 ???????? bne (rel) branch if not = zero ? z = 0 rel 26 rr 3 ???????? bpl (rel) branch if plus ? n = 0 rel 2a rr 3 ???????? bra (rel) branch always ? 1 = 1 rel 20 rr 3 ???????? brclr(opr) (msk) (rel) branch if bit(s) clear ? m  mm = 0 dir ind,x ind,y 13 1f 18 1f dd mm rr ff mm rr ff mm rr 6 7 8 ???????? brn (rel) branch never ? 1 = 0 rel 21 rr 3 ???????? brset(opr) (msk) (rel) branch if bit(s) set ? (m )  mm = 0 dir ind,x ind,y 12 1e 18 1e dd mm rr ff mm rr ff mm rr 6 7 8 ???????? bset (opr) (msk) set bit(s) m + mm ? ???? ?? ? bsr (rel) branch to subroutine see figure 3-2 rel 8d rr 6 ???????? bvc (rel) branch if overflow clear ? v = 0 rel 28 rr 3 ???????? bvs (rel) branch if overflow set ? v = 1 rel 29 rr 3 ???????? cba compare a to b a ? binh11 ? 2 ???? ???? ? ? 2 ??????? 0 cli clear interrupt mask 0 ? ? 2 ??? 0 ???? clr (opr) clear memory byte 0 ? ???? 0100 clra clear accumulator a 0 ? ? 2 ???? 0100 clrb clear accumulator b 0 ? ? 2 ???? 0100 clv clear overflow flag 0 ? ? 2 ?????? 0 ? cmpa (opr) compare a to memory a ? m a imm adir aext a ind,x a ind,y 81 91 b1 a1 18 a1 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? ? m b imm bdir bext b ind,x b ind,y c1 d1 f1 e1 18 e1 ii dd hh ll ff ff 2 3 4 4 5 ???? ???? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 58 central processor unit (cpu) motorola central processor unit (cpu) com (opr) ones complement memory byte $ff ? m ? ???? ?? ? a ? ? 2 ???? ?? ? b ? ? 2 ???? ?? ? m : m + 1 imm dir ext ind,x ind,y 1a 83 1a 93 1a b3 1a a3 cd a3 jj kk dd hh ll ff ff 5 6 7 7 7 ???? ???? ? m : m + 1 imm dir ext ind,x ind,y 8c 9c bc ac cd ac jj kk dd hh ll ff ff 4 5 6 6 7 ???? ???? ? m : m + 1 imm dir ext ind,x ind,y 18 8c 18 9c 18 bc 1a ac 18 ac jj kk dd hh ll ff ff 5 6 7 7 7 ???? ???? ? 2 ???? ???? ? 1 ? ???? ??? ? deca decrement accumulator a a ? 1 ? ? 2 ???? ??? ? decb decrement accumulator b b ? 1 ? ? 2 ???? ??? ? des decrement stack pointer sp ? 1 ? ? 3 ???????? dex decrement index register x ix ? 1 ? ? 3 ????? ? ?? dey decrement index register y iy ? 1 ? ? 4 ????? ? ?? eora (opr) exclusive or a with memory a ? ???? ?? ? eorb (opr) exclusive or b with memory b ? ???? ?? ? fdiv fractional divide 16 by 16 d / ix ? ? ? 41 ????? ??? ? ? ? 41 ????? ? ? ? ???? ??? ? inca increment accumulator a a + 1 ? ? 2 ???? ??? ? incb increment accumulator b b + 1 ? ? 2 ???? ??? ? table 3-1. instruction set (sheet 3 of 7) mnemonic operation description addressing instruction condition codes mode opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) instruction set m68hc11k family technical data motorola central processor unit (cpu) 59 ins increment stack pointer sp + 1 ? ? 3 ???????? inx increment index register x ix + 1 ? ? 3 ????? ? ?? iny increment index register y iy + 1 ? ? 4 ????? ? ?? jmp (opr) jump see figure 3-2 ext ind,x ind,y 7e 6e 18 6e hh ll ff ff 3 3 4 ???????? jsr (opr) jump to subroutine see figure 3-2 dir ext ind,x ind,y 9d bd ad 18 ad dd hh ll ff ff 5 6 6 7 ???????? ldaa (opr) load accumulator a m ? ???? ?? ? ldab (opr) load accumulator b m ? ???? ?? ? ldd (opr) load double accumulator d m ? ? ???? ?? ? lds (opr) load stack pointer m : m + 1 ? ???? ?? ? ldx (opr) load index register x m : m + 1 ? ???? ?? ? ldy (opr) load index register y m : m + 1 ? ???? ?? ? lsl (opr) logical shift left ext ind,x ind,y 78 68 18 68 hh ll ff ff 6 6 7 ???? ???? ? 2 ???? ???? ? 2 ???? ???? ? 3 ???? ???? ???? 0 ??? ? 2 ???? 0 ??? ? 2 ???? 0 ??? c 0 b7 b0 c 0 b7 b0 c 0 b7 b0 c 0 b7 b0 ab b7 b0 c 0 b7 b0 c 0 b7 b0 c 0 b7 b0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 60 central processor unit (cpu) motorola central processor unit (cpu) lsrd logical shift right double inh 04 ? 3 ???? 0 ??? ? ? ? 10 ??????? ? ? s complement memory byte 0 ? m ? ???? ???? ? s complement a 0 ? a ? ? 2 ???? ???? ? s complement b 0 ? b ? ? 2 ???? ???? ? 2 ???????? oraa (opr) or accumulator a (inclusive) a + m ? ???? ?? ? orab (opr) or accumulator b (inclusive) b + m ? ???? ?? ? psha push a onto stack a ? ? 1 a inh 36 ? 3 ???????? pshb push b onto stack b ? ? 1 b inh 37 ? 3 ???????? pshx push x onto stack (lo first) ix ? ? 2 inh 3c ? 4 ???????? pshy push y onto stack (lo first) iy ? ? 2 inh 18 3c ? 5 ???????? pula pull a from stack sp = sp + 1, a ? ? 4 ???????? pulb pull b from stack sp = sp + 1, b ? ? 4 ???????? pulx pull x from stack (hi first) sp = sp + 2, ix ? ? 5 ???????? puly pull y from stack (hi first) sp = sp + 2, iy ? ? 6 ???????? rol (opr) rotate left ext ind,x ind,y 79 69 18 69 hh ll ff ff 6 6 7 ???? ???? ? 2 ???? ???? ? 2 ???? ???? ???? ???? ? 2 ???? ???? ? 2 ???? ???? ? 12 ??????? ? 5 ???????? table 3-1. instruction set (sheet 5 of 7) mnemonic operation description addressing instruction condition codes mode opcode operand cycles s x h i n z v c c 0 b7 b0 a b b7 b0 c b7 b0 c b7 b0 c b7 b0 c b7 b0 c b7 b0 c b7 b0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) instruction set m68hc11k family technical data motorola central processor unit (cpu) 61 sba subtract b from a a ? b ? ? 2 ???? ???? ? m ? c ? ???? ???? ? m ? c ? ???? ???? ? ? 2 ??????? 1 sei set interrupt mask 1 ? ? 2 ??? 1 ???? sev set overflow flag 1 ? ? 2 ?????? 1 ? staa (opr) store accumulator a a ? ???? ?? ? stab (opr) store accumulator b b ? ???? ?? ? std (opr) store accumulator d a ? ? ???? ?? ? stop stop internal clocks ? inh cf ? 2 ???????? sts (opr) store stack pointer sp ? ???? ?? ? stx (opr) store index register x ix ? ???? ?? ? sty (opr) store index register y iy ? ???? ?? ? suba (opr) subtract memory from a a ? m ? ???? ???? ? m ? ???? ???? ? m : m + 1 ? ???? ???? ? 14 ??? 1 ???? tab transfer a to b a ? ? 2 ???? ?? ? tap transfer a to cc register a ? ? 2 ??????? ? ? 2 ???? ?? ? test test (only in test modes) address bus counts inh 00 ? * ???????? table 3-1. instruction set (sheet 6 of 7) mnemonic operation description addressing instruction condition codes mode opcode operand cycles s x h i n z v c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 62 central processor unit (cpu) motorola central processor unit (cpu) tpa transfer cc register to a ccr ? ? 2 ???????? tst (opr) test for zero or minus m ? 0 ext ind,x ind,y 7d 6d 18 6d hh ll ff ff 6 6 7 ???? ?? ? 0 a inh 4d ? 2 ???? ?? ? 0 b inh 5d ? 2 ???? ?? ? ? 3 ???????? tsy transfer stack pointer to y sp + 1 ? ? 4 ???????? txs transfer x to stack pointer ix ? 1 ? ? 3 ???????? tys transfer y to stack pointer iy ? 1 ? ? 4 ???????? wai wait for interrupt stack regs & wait inh 3e ? ** ???????? xgdx exchange d with x ix ? ? ? 3 ???????? xgdy exchange d with y iy ? ? ? 4 ???????? table 3-1. instruction set (sheet 7 of 7) mnemonic operation description addressing instruction condition codes mode opcode operand cycles s x h i n z v c cycle * infinity or until reset occurs ** 12 cycles are used beginning with the opcode fetch. a wait state is entered which remains in effect for an integer number of mpu e-clock cycles (n) until an interrupt is recognized. finally, two additional cycles are used to fetch the appropriate interrupt vector (14 + n total). operands dd = 8-bit direct address ($0000 ? $00ff) (high byte assumed to be $00) ff = 8-bit positive offset $00 (0) to $ff (255) (is added to index) hh = high-order byte of 16-bit extended address ii = one byte of immediate data jj = high-order byte of 16-bit immediate data kk = low-order byte of 16-bit immediate data ll = low-order byte of 16-bit extended address mm = 8-bit mask (set bits to be affected) rr = signed relative offset $80 ( ? 128) to $7f (+127) (offset relative to address following machine code offset byte)) operators ( ) contents of register shown inside parentheses ? ? ?  boolean and + arithmetic addition symbol except where used as inclusive-or symbol in boolean formula ? ? arithmetic subtraction symbol or negation symbol (two ? s complement) condition codes ? bit not changed 0 bit always cleared 1 bit always set ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola operating modes and on-chip memory 63 technical data ? m68hc11k family section 4. operating modes and on-chip memory 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 4.3 control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 4.4 system initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 4.5 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.1 single-chip mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.2 expanded mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.5.3 bootstrap mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 4.5.4 special test mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.5.5 mode selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 4.6 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 4.6.1 control registers and ram . . . . . . . . . . . . . . . . . . . . . . . . .84 4.6.2 rom or eprom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 4.6.3 eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.6.4 bootloader rom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 4.7 eprom/otprom (m68hc711k4 and m68hc711ks2). . . . .90 4.7.1 programming the eprom with downloaded data. . . . . . . .90 4.7.2 programming the eprom from memory . . . . . . . . . . . . . . .91 4.8 eeprom and the config register . . . . . . . . . . . . . . . . . . . .93 4.8.1 eeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.8.1.1 eeprom programming control register . . . . . . . . . . . .94 4.8.1.2 block protect register . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 4.8.1.3 system configuration options register . . . . . . . . . . . . . .97 4.8.2 eeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 4.8.2.1 eeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . .98 4.8.2.2 eeprom bulk erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.8.2.3 eeprom row erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.8.2.4 eeprom byte erase . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 4.8.3 config register programming . . . . . . . . . . . . . . . . . . . .100 4.8.4 ram and eeprom security . . . . . . . . . . . . . . . . . . . . . . .100 4.9 xout pin control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 4.9.1 system configuration register. . . . . . . . . . . . . . . . . . . . . .102 4.9.2 system configuration options 2 register . . . . . . . . . . . . .103 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 64 operating modes and on-chip memory motorola operating modes and on-chip memory 4.2 introduction this section presents the elements involved in configuring the m68hc11k/ks family microcontrollers (mcus), including:  a list of the control registers, see 4.3 control registers  special registers that control system initialization, see 4.4 system initialization  description of the four operating modes and how they ? re selected, see 4.5 operating modes  memory maps of the k family, see 4.6 memory map  information on programming eprom (erasable, programmable read-only memory) and eeprom (electrically erasable, programmable read-only memory), see 4.7 eprom/otprom (m68hc711k4 and m68hc711ks2) and 4.8 eeprom and the config register 4.3 control registers the heart of the m68hc11 family of mcus is a special register block which controls the peripheral functions. in the k family, this block is 128 bytes. the default location of this block is the first 128 bytes of memory, but software can map it to any 4-kbyte boundary (see 4.6.1 control registers and ram ). certain bits and registers that control initialization and the basic operation of the mcu are protected against writes in normal operating modes except under special circumstances. some bits cannot be written at all; others can be written only once and/or within the first 64 bus cycles after any reset. the special operating modes override these restrictions. these bits and registers are discussed in 4.4 system initialization . normal and special operating modes are discussed in 4.5 operating modes . the write-restricted registers and bits are summarized in table 4-1 . figure 4-1 lists the entire 128-byte register block in ascending order by address, using the default memory block assignment $0000 ? $007f. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 65 note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. addr. register name bit 7 6 5 4 3 2 1 bit 0 $0000 port a data register (porta) see page 138. read: pa7pa6pa5pa4pa3pa2pa1pa0 write: reset: undefined after reset $0001 port a data direction register (ddra) see page 138. read: dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 write: reset:00000000 $0002 port b data direction register (ddrb) see page 139. read: ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 write: reset:00000000 $0003 port f data direction register (ddrf) see page 144. read: ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 write: reset:00000000 $0004 port b data register (portb) see page 139. read: pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 write: reset: undefined after reset $0005 port f data register (portf) see page 144. read: pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 write: reset: undefined after reset $0006 port c data register (portc) see page 140. read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: undefined after reset $0007 port c data direction register (ddrc) see page 141. read: ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 write: reset:00000000 $0008 port d data register (portd) see page 142. read: 0 0 pd5 pd4 pd3 pd2 pd1 pd0 write: reset:0 0uuuuuu $0009 port d data direction register (ddrd) see page 142. read: 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 write: reset:00000000 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 1 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 66 operating modes and on-chip memory motorola operating modes and on-chip memory $000a port e data register (porte) see page 143. read: pe7 pe6 pe5 pe4 pe3 pe2 pd1 pd0 write: reset: undefined after reset $000b timer compare force register (cforc) see page 201. read: foc1 foc2 foc3 foc4 foc5 0 0 0 write: reset:00000000 $000c output compare 1 mask register (oc1m) see page 202. read: oc1m7 oc1m6 oc1m5 oc1m4 oc1m3 0 0 0 write: reset:00000000 $000d output compare 1 data register (oc1d) see page 202. read: oc1d7 oc1d6 oc1d5 oc1d4 oc1d3 0 0 0 write: reset:00000000 $000e timer counter register high (tcnth) see page 188. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:00000000 $000f timer counter register low (tcntl) see page 188. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset:00000000 $0010 timer input capture 1 register high (tic1h) see page 192. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: undefined after reset $0011 timer input capture 1 register low (tic1l) see page 192. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: undefined after reset $0012 timer input capture 2 register high (tic2h) see page 192. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: undefined after reset $0013 timer input capture 2 register low (tic2l) see page 192. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: undefined after reset $0014 timer input capture 3 register high (tic3h) see page 192. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: undefined after reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 2 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 67 $0015 timer input capture 3 register low (tic3l) see page 192. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: undefined after reset $0016 timer output compare 1 high register (toc1h) see page 197. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 $0017 timer output compare 1 low register (toc1l) see page 197. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 $0018 timer output compare 2 high register (toc2h) see page 197. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 $0019 timer output compare 2 low register (toc2l) see page 197. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 $001a timer output compare 3 high register (toc3h) see page 197. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 $001b timer output compare 3 low register (toc3l) see page 197. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 $001c timer output compare 4 high register (toc4h) see page 197. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 $001d timer output compare 4 low register (toc4l) see page 197. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 3 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 68 operating modes and on-chip memory motorola operating modes and on-chip memory $001e timer input capture 4/ output compare 5 reg. high (ti4h/o5h) see page 199. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 $001f timer input capture 4/ output compare 5 reg. low (ti4l/o5l) see page 199. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 $0020 timer control 1 register (tctl1) see page 200. read: om2 ol2 om3 ol3 om4 ol4 om5 ol5 write: reset:00000000 $0021 timer control 2 register (tctl2) see page 195. read: edg4b edg4a edg1b edg1a edg2b edg2a edg3b edg3a write: reset:00000000 $0022 timer interrupt mask 1 register (tmsk1) see page 200. read: oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i write: reset:00000000 $0023 timer interrupt flag 1 register (tflg1) see page 199. read: oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f write: reset:00000000 $0024 timer interrupt mask 2 register (tmsk2) see page 209. read: toi rtii paovi paii 0 0 pr1 (1) pr0 (1) write: reset:00000000 1. can be written only once in first 64 cycles out of reset in normal modes $0025 timer interrupt flag 2 (tflg2) see page 209. read: tof rtif paovf paif 0 0 0 0 write: reset:00000000 $0026 pulse accumulator control register (pactl) see page 210. read: 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 write: reset:00000000 $0027 pulse accumulator count register (pacnt) see page 208. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: undefined after reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 4 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 69 $0028 serial peripheral control register (spcr) see page 174. read: spie spe dwom mstr cpol cpha spr1 spr0 write: reset:000001uu $0029 serial peripheral status register (spsr) see page 176. read: spifwcol0modf0000 write: reset:00000000 $002a serial peripheral data register (spdr) see page 177. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: undefined after reset $002b eprom programming control register (eprog) (1) see page 91. read: r 0 elat excol exrow 0 0 epgm write: reset:00000000 1. present only in eprom (711) devices $002c port pullup assignment register (ppar) see page 147. read: 0 0 0 0 hppue gppue fppue bppue write: reset:00001111 $002d port g assignment register (pgar) see page 235. read: 0 0 pgar5 pgar4 pgar3 pgar2 pgar1 pgar0 write: reset:00000000 $002e system configuration options 3 register (opt3) (2) see page 132. read: sm write: reset:00000000 2. not available on m68hc11k4 devices $002f reserved r r r r r r r r $0030 analog-to-digital control/status register (adctl) see page 227. read: ccf 0 scan mult cd cc cb ca write: reset:0 0uuuuuu $0031 analog-to-digital results register 1 (adr1) see page 229. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 5 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 70 operating modes and on-chip memory motorola operating modes and on-chip memory $0032 analog-to-digital results register 2 (adr2) see page 229. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset $0033 analog-to-digital results register 3 (adr3) see page 229. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset $0034 analog-to-digital results register 4 (adr4) see page 229. l read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset $0035 block protect register (bprot) (1) see page 96. read: bulkp lvpen bprt4 ptcon bprt3 bprt2 bprt1 bprt0 write: reset:11111111 1. can be written only once to 0 in first 64 cycles out of reset in normal modes $0036 reserved r r r r r r r r $0037 eeprom mapping register (init2) (2) see page 89. read: ee3 ee2 ee1 ee0 0 0 0 0 write: reset:00000000 2. can only be written once after reset in normal modes $0038 system configuration options 2 register (opt2) see pages 40, 103, 112, 141, read: lirdv cwom strch (3) irvne (4) lsbf spr2 xdv1 xdv0 write: reset: 0 0 0 ? 0000 3. not available on m68hc11ks devices 4. can be written only once after reset in normal modes $0039 system configuration options register (option) see pages 97, 109, 111, 112, 121, 147 read: adpu csel irqe (5) dly (5) cme fcme (5) cr1 (5) cr0 (5) write: reset:00010000 5. can only be written once in first 64 cycles out of reset in normal modes addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 6 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 71 $003a arm/reset cop timer circuitry register (coprst) see page 110. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $003b eeprom programming control register (pprog) see page 91. read: odd even lvpi byte row erase eelat eepgm write: reset:00000000 $003c highest priority i-bit interrupt and misc. register (hprio) see pages 80, 123 read: rboot smod mda psel4 psel3 psel2 psel1 psel0 write: reset: ??? 00110 $003d ram and i/o mapping register (init) (1) see page 84. read: ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 write: reset:00000000 1. can only be written once in first 64 cycles out of reset in normal modes $003e test 1 register (test1) read: tilop 0 occr cbyp disr fcm fcop 0 write: reset:00000000 $003f system configuration register (config) see pages 88, 101, 108, 147 read: romad 1 clkx paren nosec nocop romon eeon write: reset: ? 1 ?? 1 ??? $0040 reserved r r r r r r r r to $0055 reserved r r r r r r r r $0056 memory mapping size register (mmsiz) (2) see pages 235, 243 read: mxgs2 mxgs1 w2sz1 w2sz0 0 0 w1sz1 w1sz0 write: reset:00000000 $0057 memory mapping window base register (mmwbr) (2) see page 236. read: w2a15 w2a14 w2a13 0 w1a15 w1a14 w1a13 0 write: reset:00000000 2. not available on m68hc11ks devices addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 7 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 72 operating modes and on-chip memory motorola operating modes and on-chip memory $0058 memory mapping window 1 control register (mm1cr) (1) see page 237. read: 0 x1a18 x1a17 x1a16 x1a15 x1a14 x1a13 0 write: reset:00000000 $0059 memory mapping window 2 control register (mm2cr) (1) see page 237. read: 0 x2a18 x2a17 x2a16 x2a15 x2a14 x2a13 0 write: reset:00000000 $005a chip select clock stretch register (cscstr) (1) see page 249. read: iosa iosb gp1sa gp1sb gp2sa gp2sb pcsa pcsb write: reset:00000000 $005b chip select control register (csctl) (1) see pages 240, 241 read: ioen iopl iocsa iosz gcspr pcsen pcsza pcszb write: reset:00000100 $005c general-purpose chip select 1 address register (gpcs1a) (1) see page 243. read: g1a18 g1a17 g1a16 g1a15 g1a14 g1a13 g1a12 g1a11 write: reset:00000000 $005d general-purpose chip select 1 control register (gpcs1c) (1) see pages 244, 247 read: g1dg2 g1dpc g1pol g1av g1sza g1szb g1szc g1szd write: reset:00000000 $005e general-purpose chip select 2 address register (gpcs2a) (1) see page 245. read: g2a18 g2a17 g2a16 g2a15 g2a14 g2a13 g2a12 g2a11 write: reset:00000000 $005f general-purpose chip select 2 control register (gpcs2c) (1) see pages 245, 247 read: 0 g2dpc g2pol g2av g2sza g2szb g2szc g2szd write: reset:00000000 1. not available on m68hc11ks devices $0060 pulse width modulation timer clock select register (pwclk) see page 213. read: con34 con12 pcka2 pcka1 0 pckb3 pckb2 pckb1 write: reset:00000000 $0061 pulse width modulation timer polarity register (pwpol) see page 215. read: pclk4 pclk3 pclk2 pclk1 ppol4 ppol3 ppol2 ppol1 write: reset:00000000 addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 8 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 73 $0062 pulse width modulation timer prescaler register (pwscal) see page 215. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0063 pulse width modulation timer enable register (pwen) see page 216. read: tpwsl discp 0 0 pwen4 pwen3 pwen2 pwen1 write: reset:00000000 $0064 pulse width modulation timer counter 1 register (pwcnt1) see page 217. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0065 pulse width modulation timer counter 2 register (pwcnt2) see page 217. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0066 pulse width modulation timer counter 3 register (pwcnt3) see page 217. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0067 pulse width modulation timer counter 4 register (pwcnt4) see page 217. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0068 pulse width modulation timer period 1 register (pwper1) see page 218. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0069 pulse width modulation timer period 2 register (pwper2) see page 218. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $006a pulse width modulation timer period 3 register (pwper3) see page 218. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $006b pulse width modulation timer period 4 register (pwper4) see page 218. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 9 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 74 operating modes and on-chip memory motorola operating modes and on-chip memory $006c pulse width modulation timer duty cycle 1 register (pwdty1) see page 219. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $006d pulse width modulation timer duty cycle 2 register (pwdty2) see page 219. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $006e pulse width modulation timer duty cycle 3 register (pwdty3) see page 219. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $006f pulse width modulation timer duty cycle 4 register (pwdty4) see page 219. read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 $0070 sci baud rate control register high (scbdh) see page 158. read: btst bspl 0 sbr12 sbr11 sbr10 sbr9 sbr8 write: reset:00000000 $0071 sci baud rate control register low (scbdl) see page 158. read: sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 write: reset:00000100 $0072 sci control register 1 (sccr1) see page 160. read: loops woms 0 m wake ilt pe pt write: reset:uu000000 $0073 sci control register 2 (sccr2) see page 161. read: tie tcie rie ilie te re rwu sbk write: reset:00000000 $0074 sci status register 1 (scsr1) see page 162. read: tdre tc rdrf idle or nf fe pf write: reset:00000000 $0075 sci status register 2 (scsr2) see page 164. read: 0000000 raf write: reset:11000000 $0076 sci data register (scdr) see page 165. read: r8t8000000 write: reset: undefined after reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 10 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory control registers m68hc11k family technical data motorola operating modes and on-chip memory 75 $0077 sci data register (scdr) see page 165. read: r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 write: reset: undefined after reset $0078 reserved r r r r r r r r to $007b reserved r r r r r r r r $007c port h data register (porth) see page 146. read: ph7 (1) ph6 (1) ph5 (1) ph4 (1) ph3 ph2 ph1 ph0 write: reset: undefined after reset $007d port h data direction register (ddrh) see page 146. read: ddh7 (1) ddh6 (1) ddh5 (1) ddh4 (1) ddh3 ddh2 ddh1 ddh0 write: reset:00000000 $007e port g data register (portg) see page 145. read: pg7 pg6 (1) pg5 (1) pg4 (1) pg3 (1) pg2 (1) pg1 (1) pg0 (1) write: reset: undefined after reset $007f port g data direction register (ddrg) see page 145. read: ddg7 ddg6 (1) ddg5 (1) ddg4 (1) ddg3 (1) ddg2 (1) ddg1 (1) ddg0 (1) write: reset:00000000 1. not available on m68hc11ks devices addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = undefined figure 4-1. register and control bit assignments (sheet 11 of 11) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 76 operating modes and on-chip memory motorola operating modes and on-chip memory 4.4 system initialization registers and bits that control initialization and the basic operation of the mcu are protected against writes except under special circumstances. table 4-1 lists registers that can be written only once after reset or that must be written within the first 64 cycles after reset. table 4-1. registers with limited write access operating mode register address register name must be written in first 64 cycles write anytime smod = 0 $x024 timer interrupt mask 2 (tmsk2) bits [1:0], once only bits [7:2] $x035 block protect register (bprot) clear bits, once only set bits only $x037 eeprom mapping register (init2) no, bits [7:4], once only ? $x038 system configuration options 2 register (opt2) no, bit 4, once only see opt2 description $x039 system configuration options (option) bits [5:4], bits [2:0], once only bits [7:6], bit 3 $x03c highest priority i-bit interrupt and miscellaneous (hprio) ? see hprio description $x03d ram and i/o map register (init) yes, once only ? smod = 1 $x024 timer interrupt mask 2 (tmsk2) ? all, set or clear $x035 block protect register (bprot) ? all, set or clear $x037 eeprom mapping register (init2) ? bits [7:4] $x038 system configuration options 2 register (opt2) ? see opt2 description $x039 system configuration options (option) ? all, set or clear $x03c highest priority i-bit interrupt and miscellaneous (hprio) ? see hprio description $x03d ram and i/o map register (init) ? all, set or clear $x03f system configuration register (config) ? see config description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory operating modes m68hc11k family technical data motorola operating modes and on-chip memory 77 4.5 operating modes the two normal modes of operation in the m68hc11k family are:  single-chip mode ? all port pins available for input/output (i/o); only on-board memory accessible  expanded mode ? access to internal and external memory; 25 i/o pins used for interface the two special modes of operation are:  bootstrap mode ? a variation of single-chip mode; executes a bootloader program in an internal bootstrap read-only memory (rom)  test mode ? a variation of the expanded mode used in production testing; allows privileged access to internal resources the logic levels applied at reset to input pins moda and modb determine the operating mode. see 4.5.5 mode selection . 4.5.1 single-chip mode in single-chip mode, the mcu functions as a self-contained microcontroller. in this mode, all address and data activity occurs within the mcu. ports b, c, f, g, and h are available for general-purpose i/o because the external address and data buses are not required. 4.5.2 expanded mode in expanded mode, the mcu uses ports b, c, f, and g to access a 64-kbyte address space. this includes:  the same on-chip memory addresses used in single-chip mode  external memory  peripheral devices f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 78 operating modes and on-chip memory motorola operating modes and on-chip memory port b provides the high-order address byte (addr[15:8]), port f the low-order address byte (addr[7:0]), port c the data bus (data[7:0]), and port g pin 7 the read/write line (r/w ) which controls direction of data flow. additionally, the e clock output can be used to synchronize external decoders for enable signals. expanded mode also enables these two special features available only on the k4 family devices: 1. memory expansion uses port g[5:0] to increase the available external address space to 1 mbyte. 2. four chip-select lines on port h[7:4] simplify selection of external memory devices. both of these features are described in section 11. memory expansion and chip selects . 4.5.3 bootstrap mode resetting the mcu in special bootstrap mode selects a reset vector to a special rom bootloader program at addresses $be00 ? $bfff. the bootloader program is used to download code, such as programming algorithms, into on-chip ram through the sci. to do this: 1. send a synchronization character (see table 4-2 ) to the sci receiver at the specified baud rate. 2. download up to 768 bytes (1 kbyte for ks2) of program data, which the cpu places into ram starting at $0080 and also echoes back on the txd signal. the bootloader program ends the download after the ram is full or when the received data line is idle for at least four character times. see table 4-2 . when loading is complete, the mcu jumps to location $0080 and begins executing the code. interrupt vectors are directed to ram, which allows the use of interrupts through a jump table. the sci transmitter requires an external pullup resistor since it is part of port d, which the bootloader configures for wired-or operation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory operating modes m68hc11k family technical data motorola operating modes and on-chip memory 79 for a detailed description of bootstrap mode, refer to the motorola application note entitled mc68hc11 bootstrap mode , document order number an1060/d. 4.5.4 special test mode special test mode, a variation of the expanded mode, is used primarily during motorola ? s internal production testing. however, for those devices containing eprom, it can be used to program the eprom for program calibration data in eeprom and support emulation and debugging during development. for more detailed information, refer to 4.7.1 programming the eprom with downloaded data . 4.5.5 mode selection the operating mode is selected by applying the appropriate logic states to the moda and modb pins during reset. moda selects single-chip mode (0) or expanded mode (1). a logic high on modb selects normal modes, and vectors are fetched from memory area $ffc0 ? $ffff. a logic low on modb selects special modes, and reset vectors are fetched from memory area $bfc0 ? $bfff. values reflecting the selected mode are latched into the rboot, smod, and mda bits of the highest priority i-bit interrupt and miscellaneous register (hprio) on the rising edge of reset . table 4-2. synchronization character selection synchronization character timeout delay baud rate at e clocks 2 mhz 3 mhz 4 mhz $ff 4 characters 7812 11,718 15,624 $ff 4 characters 1200 1800 2400 $f0 4.9 characters 9600 14,400 19,200 $fd 13 characters 3906 5859 7812 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 80 operating modes and on-chip memory motorola operating modes and on-chip memory table 4-3 summarizes the inputs, modes selected, and register bits latched. the hprio register is illustrated in figure 4-2 . rboot ? read bootstrap rom bit in special modes, this bit enables the bootloader rom 0 = bootloader rom disabled and not in map 1 = bootloader rom enabled and located in map at $be00 ? $bfff in normal modes this bit is clear and cannot be written. smod ? special mode select bit this bit reflects the inverse of the modb input pin at the rising edge of reset . if modb is low during reset, smod is set; if modb is high during reset, smod is cleared. software can clear the smod bit, but cannot set it. thus, it is possible for software to change the operating table 4-3. hardware mode select summary inputs mode control bits in hprio latched at reset modb moda rboot smod mda 1 0 single-chip 0 0 0 1 1 expanded 0 0 1 0 0 special bootstrap 1 1 0 01 special test 011 address: $003c bit 7654321bit 0 read: rboot (1) smod (1) mda (1) psel4 psel3 psel2 psel1 psel0 write: reset: ??? 00110 1. the values of the rboot, smod, and mda bits at reset depend on the mode during initialization. figure 4-2. highest priority i-bit interrupt and miscellaneous register (hprio) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory memory map m68hc11k family technical data motorola operating modes and on-chip memory 81 mode from special to normal, but not vice versa. to switch from a special mode to a normal mode, write to the access-limited registers (see table 4-1 ) before clearing smod. 0 = normal mode operation in effect 1 = special mode operation in effect mda ? mode select a bit the mode select a bit reflects the status of the moda input pin at the rising edge of reset . software can change the mda bit only while the smod bit is set, effectively switching the operating mode between special bootstrap and special test modes. once the smod bit is clear, the moda bit is read-only and the operating mode cannot be changed without going through a reset sequence. 0 = normal single-chip or special bootstrap mode in effect 1 = normal expanded or special test mode in effect after reset is released, the mode select pins revert to their alternate functions, described in 2.9 mode selection, instruction cycle reference, and standby power (moda/lir and modb/vstby) , and no longer influence the mcu operating mode. 4.6 memory map the operating mode determines memory mapping and whether memory is addressed on-chip or off-chip. figure 4-3 and figure 4-4 illustrate the m68hc11k4 family and m68hc11ks family memory maps for each of the four modes of operation. memory locations for on-chip resources are the same for both expanded and single-chip modes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 82 operating modes and on-chip memory motorola operating modes and on-chip memory figure 4-3. m68hc11k4 family memory map $0380 $1000 $0d80 $a000 $ffc0 $ffff external 0000 007f 0080 037f 0d80 0fff a000 ffff external external be00 bfc0 bfff ffc0 ffff single chip expanded bootstrap special test external note 1.eprom can be enabled in special test mode by setting the romon bit in the config register after reset. 128-byte register block (can be remapped to any 4-kbyte boundary by the init register) 768 bytes ram (can be remapped to any 4-kbyte boundary by the init register) 640 bytes eeprom (can be remapped to any 4-kbyte boundary by the init2 register) boot rom (only present in special boot mode) special modes interrupt vectors normal modes interrupt vectors 24-kbyte rom/ eprom (can be re-mapped to $2000 ? $7fff by the config register) (1),(2) $0000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory memory map m68hc11k family technical data motorola operating modes and on-chip memory 83 figure 4-4. m68hc11ks2 family memory map table 4-4 shows the default memory map addresses for the m68hc11k family devices. $0480 $1000 $0d80 $8000 $ffc0 $ffff external 0000 007f 0080 047f 0d80 0fff 8000 ffff external external be00 bfc0 bfff ffc0 ffff single- chip expanded bootstrap special test external note: 1.eprom can be enabled in special test mode by setting the romon bit in the config register after reset. 128-byte register block (can be remapped to any 4k boundary by the init register) 1.0-kbyte ram (can be remapped to any 4-kbyte boundary by the init register) 640-byte eeprom (can be remapped to any 4-kbyte boundary by the init2 register) boot rom (only present in special boot mode) special modes interrupt vectors normal modes interrupt vectors 32k rom/ eprom (can be re-mapped to $0000 ? $7fff by the config register) (1),(2) $0000 table 4-4. default memory map addresses [7]11k4 [7]11ks2 registers $0000 ? $007f $0000 ? $007f ram $0080 ? $037f $0080 ? $047f eeprom $0d80 ? $0fff $0d80 ? $0fff rom/eprom $a000 ? $ffff $8000 ? $ffff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 84 operating modes and on-chip memory motorola operating modes and on-chip memory 4.6.1 control registers and ram out of reset, the 128-byte register block is mapped to $0000 and the 768-byte ram (1 kbyte on the [7]11ks2) is mapped to $0080. both the register block and the ram can be placed at any other 4-kbyte boundary ($x000 and $x080, respectively) by writing the appropriate value to the init register. note: init is writable once in normal modes and writable at any time in special modes. ram[3:0] ? ram map position bits these four bits determine the position of ram in the memory map by specifying the upper hexadecimal digit of the ram address. refer to table 4-5 . reg[3:0] ? register block position bits these four bits determine the position of the register block in memory by specifying the upper hexadecimal digit of the block address. refer to table 4-6 . address: $003d bit 7654321bit 0 read: ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 write: reset:00000000 figure 4-5. ram and i/o mapping register (init) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory memory map m68hc11k family technical data motorola operating modes and on-chip memory 85 table 4-5. ram mapping ram[3:0] address (1) 1. ram[3:0] = reg[3:0]: on the [7]11ks2, ram address range is $x080 ? $x47f. address (2) 2. ram[3:0] ? $x37f. 0000 $0080 ? $037f (3) 3. default locations out of reset $0000 ? $02ff 0001 $1080 ? $137f $1000 ? $12ff 0010 $2080 ? $237f $2000 ? $22ff 0011 $3080 ? $337f $3000 ? $32ff 0100 $4080 ? $437f $4000 ? $42ff 0101 $5080 ? $537f $5000 ? $52ff 0110 $6080 ? $637f $6000 ? $62ff 0111 $7080 ? $737f $7000 ? $72ff 1000 $8080 ? $837f $8000 ? $82ff 1001 $9080 ? $937f $9000 ? $92ff 1010 $a080 ? $a37f $a000 ? $a2ff 1011 $b080 ? $b37f $b000 ? $b2ff 1100 $c080 ? $c37f $c000 ? $c2ff 1101 $d080 ? $d37f $d000 ? $d2ff 1110 $e080 ? $e37f $e000 ? $e2ff 1111 $f080 ? $f37f $f000 ? $f2ff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 86 operating modes and on-chip memory motorola operating modes and on-chip memory since the direct addressing mode accesses ram more quickly and efficiently than other addressing modes, many applications will find the default locations of registers and on-board ram at the bottom of memory to be the most advantageous. when ram and the registers are both mapped to different 4-k boundaries, the registers are mapped at $x000 ? $x07f, and ram is moved to $x000 ? $x2ff ($x000 ? x3ff for the [7]11ks2). table 4-6. register mapping reg[3:0] address 0000 $0000 ? $007f (1) 1. default locations out of reset. 0001 $1000 ? $107f 0010 $2000 ? $207f 0011 $3000 ? $307f 0100 $4000 ? $407f 0101 $5000 ? $507f 0110 $6000 ? $607f 0111 $7000 ? $707f 1000 $8000 ? $807f 1001 $9000 ? $907f 1010 $a000 ? $a07f 1011 $b000 ? $b07f 1100 $c000 ? $c07f 1101 $d000 ? $d07f 1110 $e000 ? $e07f 1111 $f000 ? $f07f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory memory map m68hc11k family technical data motorola operating modes and on-chip memory 87 4.6.2 rom or eprom the presence and location of the 24-kbyte (ep)rom on the [7]11k4 is determined by two bits in the system configuration register (config). the config register is a special eeprom register (see figure 4-6 ). (ep)rom is present in the memory map when the romon bit is set and removed from the memory map when the bit is cleared. the default location of this memory is $a000 ? $ffff, but it can be moved to $2000 ? $7fff in expanded mode by clearing the romad bit. both bits are set out of reset in single-chip mode.  on the [7]11ks2, (ep)rom is 32 k, mapped to $8000 ? $ffff by default, and moved to $0000 ? $7fff by clearing the romad bit. in special test mode, the romon bit is forced to 0, removing (ep)rom from the memory map. 4.6.3 eeprom the m68hc11k family devices contain 640 bytes of eeprom. it is initially located at $0d80 after reset if it is enabled by the eeon bit in the config register (see figure 4-6 ). it can be relocated to any 4-k boundary ($xd80) by writing to the eeprom mapping register (init2) (see figure 4-7 ). note: on the m68hc11k devices, the eeprom can be mapped to where it will contain the vector space. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 88 operating modes and on-chip memory motorola operating modes and on-chip memory note: config is writable once in normal modes and writable at any time in special modes. romad ? rom address mapping control bit set out of reset in single-chip mode 0 = (ep)rom set at $2000 ? $7fff; $0000 ? $7fff in [7]11ks2; $0000 ? $bfff in [7]11ks8 (expanded mode only) 1 = (ep)rom set at $a000 ? $ffff; $8000 ? $ffff in [7]11ks2; $4000 ? $ffff in [7]11ks8 romon ? rom/prom enable bit set by reset in single-chip mode; cleared by reset in special test mode 0 = (ep)rom removed from the memory map 1 = (ep)rom present in the memory map eeon ? eeprom enable bit 0 = 640-byte eeprom disabled 1 = 640-byte eeprom enabled address: $003f bit 7654321bit 0 read: romad 1 clkx paren nosec nocop romon eeon write: reset: ? 1 ?????? figure 4-6. system configuration register (config) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory memory map m68hc11k family technical data motorola operating modes and on-chip memory 89 note: init2 is writable once in normal modes and writable at any time in special modes. ee[3:0] ? eeprom map position bits these four bits determine the most-significant hexadecimal digit in the address range of the eeprom, as shown in table 4-7 . address: $0037 bit 7654321bit 0 read: ee3 ee2 ee1 ee0 0 0 0 0 write: reset:00000000 figure 4-7. eeprom mapping register (init2) table 4-7. eeprom map ee[3:0] location 0000 $0d80 ? $0fff 0001 $1d80 ? $1fff 0010 $2d80 ? $2fff 0011 $3d80 ? $3fff 0100 $4d80 ? $4fff 0101 $5d80 ? $5fff 0110 $6d80 ? $6fff 0111 $7d80 ? $7fff 1000 $8d80 ? $8fff 1001 $9d80 ? $9fff 1010 $ad80 ? $afff 1011 $bd80 ? $bfff 1100 $cd80 ? $cfff 1101 $dd80 ? $dfff 1110 $ed80 ? $efff 1111 $fd80 ? $ffff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 90 operating modes and on-chip memory motorola operating modes and on-chip memory 4.6.4 bootloader rom the bootloader program occupies 512 bytes of bootstrap rom at addresses $be00 ? $bfff. it is active only in special modes when the rboot bit in the hprio register is set. 4.7 eprom/otprom (m68hc711k4 and m68hc711ks2) the m68hc711k4 devices include 24 kbytes of on-chip eprom (otprom in non-windowed packages). the m68hc711ks2 has 32 kbytes of eprom. the two methods available to program the eprom are:  downloading data through the serial communication interface (sci) in bootstrap or special test mode  programming individual bytes from memory before proceeding with programming:  ensure that the config register romon bit is set.  ensure that the irq pin is pulled to a high level.  apply 12 volts to the xirq /v pp pin. program the eprom only at room temperature. place an opaque label over the quartz window on windowed parts after programming. 4.7.1 programming the eprom with downloaded data the mcu can download eprom data through the sci while in the special test or bootstrap modes. this can be done either with custom software, also downloaded through the sci, or with a built-in utility program in bootstrap rom. in either case, the 12-volt nominal programming voltage must be present on the xirq /v pp pin. to use the bootstrap rom utility, download a 3-byte program consisting of a single jump instruction to $bf00, the starting address of the resident eprom programming utility. the utility program sets the x and y index f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eprom/otprom (m68hc711k4 and m68hc711ks2) m68hc11k family technical data motorola operating modes and on-chip memory 91 registers to default values, then receives data from an external host and programs it into the eprom. the value in the x index register determines programming delay time. the value in the y index register is a pointer to the first address in eprom to be programmed. the default starting address is $8000 for the m68hc11ks2. when the utility program is ready to receive programming data, it sends the host a $ff character and waits for a reply. when the host sees the $ff character, it sends the eprom programming data, starting with the first location in the eprom array. after the mcu receives the last byte to be programmed and returns the corresponding verification data, it terminates the programming operation by initiating a reset. refer to the motorola application note entitled mc68hc11 bootstrap mode, document order number an1060/d. 4.7.2 programming the eprom from memory in this method, software programs the eprom one byte at a time. each byte is read from memory, then latched and programmed into the eprom using the eprom programming control register (eprog). this procedure can be done in any operating mode. mbe ? multiple-byte program enable bit mbe is for factory use only and is accessible only in special test mode. when mbe is set, the mcu ignores address bit 5, so that bytes with addr5 = 0 and addr5 = 1 both get programmed with the same data. 0 = normal programming 1 = multiple-byte programming enabled address: $002b bit 7654321bit 0 read: r 0 elat excol exrow 0 0epgm write: reset:00000000 r= reserved figure 4-8. eprom programming control register (eprog) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 92 operating modes and on-chip memory motorola operating modes and on-chip memory elat ? eprom latch control bit setting elat latches the address and data of writes to the eprom. the eprom cannot be read. elat can be read at any time. elat can be written any time except when pgm = 1, which disables writes to elat. 0 = eprom address and data bus configured for normal reads. eprom cannot be programmed. 1 = eprom address and data bus are configured for programming. address and data of writes to eprom are latched. eprom cannot be read. excol ? select extra columns bit excol is for factory use only and is accessible only in special test mode. when excol equals 1, extra columns can be accessed at bit 7 and bit 0. addresses use bits [11:5]. bits [4:1] are ignored. 0 = user array selected 1 = extra columns selected and user array disabled exrow ? select extra rows bit exrow is for factory use only and is only accessible in special test mode. when exrow equals 1, two extra rows are available. addresses use bits [5:0]. bits [11:6] are ignored. 0 = user array selected 1 = extra rows selected and user array is disabled epgm ? eprom programming enable bit epgm applies programming voltage (v pp ) to the eprom. epgm can be read at any time. epgm can be written only when elat = 1. 0 = programming voltage to eprom array is disconnected 1 = programming voltage to eprom array is connected; elat cannot be changed. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eeprom and the config register m68hc11k family technical data motorola operating modes and on-chip memory 93 this procedure programs one byte into eprom. on entry, accumulator a contains the byte of data to be programmed and x contains the target eprom address. eprog ldab #$20 stab $002b set elat bit to enable eprom latches. (epgm must be 0.) staa $0,x store data to eprom address ldab #$21 stab $002b set epgm bit with elat=1 to enable eprom programming voltage jsr dlyep delay 1-2 ms clr $002b turn off programming voltage and set to read mode 4.8 eeprom and the config register the 640-byte on-board eeprom is enabled by the eeon bit in the config register and located on a 4-k boundary determined by the init2 register ( 4.6.3 eeprom ). an internal charge pump supplies the programming voltage for the eeprom, eliminating the need for an external high-voltage supply. when appropriate bits in the bprot register are cleared, the pprog register controls programming and erasing the eeprom. the pprog register can be read or written at any time, but logic enforces defined programming and erasing sequences to prevent unintentional changes to eeprom data. when the eelat bit in the pprog register is cleared, the eeprom can be read as if it were a rom. the clock source driving the charge pump is software selectable. when the clock select (csel) bit in the option register is 0, the e clock is used; when csel is 1, an on-chip resistor-capacitor (rc) oscillator is used. the eeprom programming voltage power supply voltage to the eeprom array is not enabled until there has been a write to pprog with eelat set and pgm cleared. this must be followed by a write to a valid eeprom location or to the config address, and then a write to pprog with both the eelat and epgm bits set. any attempt to set f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 94 operating modes and on-chip memory motorola operating modes and on-chip memory both eelat and epgm during the same write operation results in neither bit being set. 4.8.1 eeprom registers this section describes the eeprom registers:  block protect register (bprot)  eeprom programming control register (pprog)  system configuration options register (option) the eeprom programming control register (pprog) controls programming and erasing. the block protect register (bprot) can prevent inadvertent writes to (or erases of) blocks of eeprom and the config register. the csel bit in the system configuration options register (option) selects an on-chip oscillator clock for programming and erasing when operating at frequencies below 1 mhz. 4.8.1.1 eeprom programming control register odd ? program odd rows in half of eeprom bit this bit is accessible only in test mode. even ? program even rows in half of eeprom bit this bit is accessible only in test mode. address: $003b bit 7654321bit 0 read: odd even lvpi byte row erase eelat eepgm write: reset:00000000 = unimplemented figure 4-9. eeprom programming control register (pprog) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eeprom and the config register m68hc11k family technical data motorola operating modes and on-chip memory 95 lvpi ? low-voltage programming inhibit bit lvpi is a read-only bit which always reads as 0. the functionality of this status bit was changed from early versions of the m68hc11k family. the low-voltage programming inhibit function is disabled on all recent devices. byte ? byte/other eeprom erase mode bit 0 = row or bulk erase mode used 1 = erase only one byte of eeprom row ? row/all eeprom erase mode bit 0 = all 640 bytes of eeprom erased 1 = erase only one 16-byte row of eeprom note: row is valid only when byte = 0. the byte and row bits work together to determine the scope of erasing, as shown in table 4-8 . erase ? erase/normal control for eeprom bit 0 = normal read or program mode 1 = erase mode eelat ? eeprom latch control bit 0 = eeprom address and data bus configured for normal reads 1 = eeprom address and data bus configured for programming or erasing eepgm ? eeprom program command bit 0 = program or erase voltage switched off to eeprom array 1 = program or erase voltage switched on to eeprom array table 4-8. scope of eeprom erase byte row action 0 0 bulk erase; all 640 bytes 0 1 row erase; 16 bytes 1 0 byte erase 1 1 byte erase f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 96 operating modes and on-chip memory motorola operating modes and on-chip memory 4.8.1.2 block protect register this register prevents inadvertent writes to both the config register and eeprom. the active bits in this register are initialized to 1 out of reset and can be cleared only during the first 64 e-clock cycles after reset in the normal modes. when these bits are cleared, the associated eeprom section and the config register can be programmed or erased. eeprom is only visible if the eeon bit in the config register is set. the bits in the bprot register can be written to 1 at any time to protect eeprom and the config register. in test or bootstrap modes, write protection is inhibited and bprot can be written repeatedly. bulkp ? bulk erase of eeprom protect bit 0 = eeprom can be bulk erased normally. 1 = eeprom cannot be bulk or row erased. lvpen ? low-voltage programming protect enable bit the functionality of lvpen/lvpi was changed from earlier versions of the m68hc11k family. setting this bit has no effect on the lvpi bit in the pprog register. 0 = low-voltage programming inhibit (lvpi) for eeprom disabled 1 = low-voltage programming inhibit (lvpi) for eeprom disabled bprt[4:0] ? block protect bits for eeprom bits, see table 4-9 0 = protection disabled for associated block 1 = protection enabled for associated block address: $0035 bit 7654321bit 0 read: bulkp lvpen bprt4 ptcon bprt3 bprt2 bprt1 bprt0 write: reset:11111111 figure 4-10. block protect register (bprot) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eeprom and the config register m68hc11k family technical data motorola operating modes and on-chip memory 97 4.8.1.3 system configuration options register csel ? clock select bit selects the built-in rc clock source for on-chip eeprom and a/d charge pumps. this clock should be used when the e clock falls below 1 mhz. 0 = a/d and eeprom use system e clock. 1 = a/d and eeprom use internal rc clock. 4.8.2 eeprom programming to write to any eeprom byte, it must first be erased, for instance, all of its bits must be set. a single byte, a row, or the entire eeprom in a single procedure can be erased by adjusting the byte and row bits in pprog. once the targeted area has been erased, each byte can be individually written. table 4-9. eeprom block protect bit name block protected block size bprt0 $xd80 ? $xd9f 32 bytes bprt1 $xda0 ? $xddf 64 bytes bprt2 $xde0 ? $xe5f 128 bytes bprt3 $xe60 ? $xf7f 288 bytes bprt4 $xf80 ? $xfff 128 bytes address: $0039 bit 7654321bit 0 read: adpu csel irqe dly (1) cme fcme (1) cr1 (1) cr0 (1) write: reset:00010000 1. can be written only once in first 64 cycles out of reset in normal modes or at any time in special modes. figure 4-11. system configuration options register (option) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 98 operating modes and on-chip memory motorola operating modes and on-chip memory the procedures for both writing and erasing involve these five steps: 1. set the eelat bit in pprog . if erasing, also set the erase bit and the appropriate byte and row bits. 2. write data to the appropriate eeprom address . if erasing, any data will work. to erase a row, write to any location in the row. to erase the entire eeprom, write to any location in the array. this step is done before applying the programming voltage because setting the eepgm bit inhibits writes to eeprom addresses. 3. set the eepgm bit in pprog, keeping eelat set. if erasing, also set the erase bit and the appropriate byte and row bits. 4. delay for 10 ms . 5. clear the pprog register to turn off the high voltage and reconfigure the eeprom address and data buses for normal operation. the following examples demonstrate programming a single eeprom byte, erasing the entire eeprom, erasing a row (16 bytes), and erasing a single byte. 4.8.2.1 eeprom programming on entry, accumulator a contains the data to be written and x points to the address to be programmed. eeprog ldab #$02 stab $003b set eelat bit to enable eeprom latches. staa $0,x store data to eprom address ldab #$03 stab $002b set epgm bit with elat=1 to enable eeprom programming voltage jsr dly10 delay 10 ms clr $003b turn off programming voltage and set to read mode f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eeprom and the config register m68hc11k family technical data motorola operating modes and on-chip memory 99 4.8.2.2 eeprom bulk erase bulke ldab #$06 stab $003b set eelat and erase. staa $0,x store any data to any eeprom address ldab #$07 stab $002b set eepgm bit as well to enable eeprom programming voltage jsr dly10 delay 10 ms clr $003b turn off programming voltage and set to read mode 4.8.2.3 eeprom row erase rowe ldab #$07 stab $003b set eelat, erase and row. staa $0,x store any data to any eeprom address in row ldab #$07 stab $002b set eepgm bit as well to enable eeprom programming voltage jsr dly10 delay 10 ms clr $003b turn off programming voltage and set to read mode 4.8.2.4 eeprom byte erase bytee ldab #$16 stab $003b set eelat, erase and byte. staa $0,x store any data to targeted eeprom address ldab #$17 stab $002b set eepgm bit as well to enable eeprom programming voltage jsr dly10 delay 10 ms clr $003b turn off programming voltage and set to read mode f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 100 operating modes and on-chip memory motorola operating modes and on-chip memory 4.8.3 config register programming the config register is implemented with eeprom cells, so eeprom procedures are required to change it. config can be programmed or erased (including byte erase) while the mcu is operating in any mode, provided that ptcon in bprot is clear. ptcon ? protect for config bit 0 = config register can be programmed or erased normally. 1 = config register cannot be programmed or erased. to change the value in the config register, complete this procedure. do not initiate a reset until the procedure is complete.  erase the config register.  program the new value to the config address.  initiate reset. 4.8.4 ram and eeprom security the nosec bit in the config register enables and disables an optional security feature which protects the contents of eeprom and ram from unauthorized access. this is done by restricting operation to single-chip modes, preventing the memory locations from being monitored externally. single-chip modes do not allow visibility of the internal address and data buses. resident programs, however, have unlimited access to the internal eeprom and ram and can read, write, or transfer the contents of these memories. address: $0035 bit 7654321bit 0 read: bulkp lvpen bprt4 ptcon bprt3 bprt2 bprt1 bprt0 write: reset:11111111 figure 4-12. block protect register (bprot) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory eeprom and the config register m68hc11k family technical data motorola operating modes and on-chip memory 101 note: config is writable once in normal modes and writable at any time in special modes. nosec ? ram and eprom security disabled bit 0 = enable security 1 = disable security m68hc11k family devices are normally manufactured with nosec set and the security option unavailable. however, on special request, a mask option is selected during fabrication that enables the security mode. the secure mode can be invoked on these parts by clearing nosec. contact a motorola representative for information on the availability of this feature. the bootstrap program performs this sequence when the security feature is present, enabled, and bootstrap mode is selected: 1. output $ff, all 1s, on the sci. 2. clear the bprot register by turning block protect off. 3. if the eeprom is enabled, erase the eeprom. 4. verify that the eeprom is erased. if eeprom is not erased, begin sequence again. 5. write $ff, all 1s, to the entire block of ram. 6. erase the config register. if all of the operations are successful, the bootload process continues as if the device was never secured. address: $003f bit 7654321bit 0 read: romad 1 clkx paren nosec nocop romon eeon write: reset: ? 1 ?? 1 ??? figure 4-13. system configuration register (config) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 102 operating modes and on-chip memory motorola operating modes and on-chip memory 4.9 xout pin control the xout pin provides a buffered xtal signal to synchronize external devices with the mcu. it is enabled by the clkx bit in the system configuration (config) register. the frequency of xout can be divided by one-of-four divisors selected by the xdv[1:0] bits in the system configuration options 2 (opt2) register. the xout pin is not configured on all packages. refer to the pin assignments in section 2. pin description . 4.9.1 system configuration register writable once in normal modes and writable at any time in special modes clkx ? xout clock enable bit the clkx bit is a switch that enables a buffered clock running at the same frequency as a referenced crystal. this buffered clock is intended to synchronize external devices with the mcu. 0 = the xout pin is disabled. 1 = the x clock is driven out on the xout pin. address: $003f bit 7654321bit 0 read: romad 1clkx paren nosec nocop romon eeon write: reset: ? 1 ?? 1 ??? figure 4-14. system configuration register (config) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes and on-chip memory xout pin control m68hc11k family technical data motorola operating modes and on-chip memory 103 4.9.2 system configuration options 2 register xdv[1:0] ? xout clock divide select bits these two bits select the divisor for the xout clock frequency, as shown in table 4-10 . the divisor is set to 1 out of reset (xout = xtal). it takes a maximum of 16 cycles after writing these bits for xout to stabilize. the phase relationship between xout and xtal cannot be predicted. address: $0038 bit 7654321bit 0 read: lirdv cwom strch (1) irvne lsbf spr2xdv1xdv0 write: reset: 0 0 0 ? 0000 1. not available on m68hc11k devices figure 4-15. system configuration options 2 register (opt2) table 4-10. xout frequencies xdv[1:0] extal divided by frequency at extal = 8 mhz frequency at extal = 12 mhz frequency at extal = 16 mhz frequency at extal = 16 mhz 0 0 1 8 mhz 12 mhz 16 mhz 20 mhz 0 1 4 2 mhz 3 mhz 4 mhz 5 mhz 1 0 6 1.33 mhz 2 mhz 2.67 mhz 3.33 mhz 1 1 8 1 mhz 1.5 mhz 2 mhz 2.5 mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 104 operating modes and on-chip memory motorola operating modes and on-chip memory f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola resets and interrupts 105 technical data ? m68hc11k family section 5. resets and interrupts 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 5.3 sources of resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 5.3.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . .107 5.3.2 external reset (reset ) . . . . . . . . . . . . . . . . . . . . . . . . . .107 5.3.3 computer operating properly (cop) system . . . . . . . . . .107 5.3.3.1 system configuration register . . . . . . . . . . . . . . . . . . .108 5.3.3.2 system configuration options register . . . . . . . . . . . . .109 5.3.3.3 arm/reset cop timer circuitry register. . . . . . . . . . . .110 5.3.4 clock monitor reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 5.3.4.1 system configuration options register . . . . . . . . . . . . .111 5.3.4.2 system configuration options register 2 . . . . . . . . . . .112 5.4 effects of reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 5.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 5.5.1 non-maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . .120 5.5.1.1 non-maskable interrupt request (xirq ) . . . . . . . . . . . .120 5.5.1.2 illegal opcode trap . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 5.5.1.3 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . .121 5.5.2 maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 5.6 reset and interrupt priority. . . . . . . . . . . . . . . . . . . . . . . . . . .122 5.7 reset and interrupt processing . . . . . . . . . . . . . . . . . . . . . . .123 5.8 low-power operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 5.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 5.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 5.8.3 slow mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 106 resets and interrupts motorola resets and interrupts 5.2 introduction when a reset or interrupt occurs, the microcontroller (mcu) retrieves the starting address of a program or interrupt routine from a vector table in memory and loads it in the program counter. a reset immediately stops execution of the current instruction and reinitializes the control registers. an interrupt preserves the current program status, performs an interrupt service routine, and resumes operation as if there had been no interruption. 5.3 sources of resets the four sources of reset are:  power-on reset (por)  external reset (reset )  computer operating properly (cop) system  clock monitor note: power-on reset and external reset share the same interrupt vectors. the cpu fetches a restart vector during the first three clock cycles after reset and begins executing instructions. vector selection is based on the type of reset and operating mode, as shown in table 5-1 . table 5-1. reset vectors operating mode por or reset clock monitor cop watchdog normal $fffe and $ffff $fffc and $fffd $fffa and $fffb test or bootstrap $bffe and $bfff $bffc and $bffd $bffa and $bffb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts sources of resets m68hc11k family technical data motorola resets and interrupts 107 5.3.1 power-on reset (por) a positive transition on v dd generates a por, which is used only for power-up conditions. por cannot be used to detect drops in power supply voltages. the cpu delays 4064 internal clock cycles after the oscillator becomes active to allow the clock generator to stabilize, then checks the reset pin. if reset is at logical 0, the cpu remains in the reset condition until the reset pin goes to logical 1. 5.3.2 external reset (reset ) the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic 1 in less than two e-clock cycles after an internal device releases reset. when a reset condition is sensed, the reset pin is driven low by an internal device for four e-clock cycles, then released. two e-clock cycles later, it is sampled. if the pin is still held low, the cpu assumes that an external reset has occurred. if the pin is high, it indicates that the reset was initiated internally by either the cop system or the clock monitor. note: it is not advisable to connect an external resistor capacitor (rc) power-up delay circuit to the reset pin of m68hc11 devices because the circuit charge time constant can cause the device to misinterpret the type of reset that occurred. 5.3.3 computer operating properly (cop) system the mcu includes a cop system to help protect against software failures. when the cop is enabled, software periodically reinitializes a free-running watchdog timer before it times out and resets the system. such a system reset indicates that a software error has occurred. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 108 resets and interrupts motorola resets and interrupts three registers are involved in cop operation:  the config register contains a bit which determines whether the cop system is enabled or disabled.  the option register contains two bits which determine the cop timeout period.  the coprst register must be written by software to reset the watchdog timer. note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. 5.3.3.1 system configuration register in normal modes, cop is enabled out of reset and does not depend on software action. to disable the cop system, set the nocop bit in the config register (see figure 5-1 ). in special test and bootstrap operating modes, the cop system is initially inhibited by the disable resets (disr) control bit in the test1 register. the disr bit can subsequently be written to 0 to enable cop resets. note: config is writable once in normal modes and writable at any time in special modes. nocop ? cop system disable bit 0 = cop enabled 1 = cop disabled address: $003f bit 7654321bit 0 read: romad 1 clkx paren nosec nocop romon eeon write: reset: ? 1 ?? 1 ??? figure 5-1. system configuration register (config) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts sources of resets m68hc11k family technical data motorola resets and interrupts 109 5.3.3.2 system configuration options register two bits in the option register select one of four values for the cop timer. cr[1:0] ? cop timer rate select bits the mcu derives the counter for the cop timer by dividing the system e clock by 2 15 and applying a further scaling factor selected by cr[1:0] as shown in table 5-2 . after reset, these bits are 0, and that condition selects the fastest timeout period. note: in normal operating modes, these bits can be written only once within 64 bus cycles after reset. address: $0039 bit 7654321bit 0 read: adpu csel irqe dly cme fcme cr1 cr0 write: reset:00010000 figure 5-2. system configuration options register (option) table 5-2. cop timeout extal frequencies extal freq. 8.0 mhz 12.0 mhz 16.0 mhz 20.0 mhz 24.0 mhz other extal e clock freq. 2.0 mhz 3.0 mhz 4.0 mhz 5.0 mhz 6.0 mhz extal f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 110 resets and interrupts motorola resets and interrupts 5.3.3.3 arm/reset cop timer circuitry register to prevent a cop reset, this sequence must be completed: 1. write $55 to coprst to arm the cop timer clearing mechanism. 2. write $aa to coprst to clear the cop timer. note: performing instructions between these two steps is possible as long as both steps are completed in the correct sequence before the timer times out. 5.3.4 clock monitor reset the clock monitor can serve as a backup for the cop system. its circuit is based on an internal rc time delay. if no mcu clock edges are detected within this rc time delay, the clock monitor generates a system reset. because the cop needs a clock to function, it is disabled when the clocks stop. thus, the clock monitor system can detect clock failures not detected by the cop system. address: $003a bit 7654321bit 0 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 5-3. arm/reset cop timer circuitry register (coprst) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts sources of resets m68hc11k family technical data motorola resets and interrupts 111 5.3.4.1 system configuration options register the clock monitor function is enabled or disabled by the cme control bit in the option register (see figure 5-4 ). the fcme bit in option overrides cme and enables the clock monitor until the next reset. note: in normal operating modes, these bits can be written only once within 64 bus cycles after reset. cme ? clock monitor enable bit this control bit can be read or written at any time and controls whether or not the internal clock monitor circuit triggers a reset sequence when the system clock is slow or absent. when it is clear, the clock monitor circuit is disabled. when it is set, the clock monitor circuit is enabled. reset clears the cme bit. 0 = clock monitor disabled 1 = clock monitor enabled fcme ? force clock monitor enable bit 0 = clock monitor follows the state of the cme bit. 1 = clock monitor is enabled until the next reset. semiconductor wafer processing causes variations of the rc timeout values between individual devices. an e-clock frequency below 10 khz generates a clock monitor error. an e-clock frequency of 200 khz or more prevents clock monitor errors. using the clock monitor function when the e clock is below 200 khz is not recommended. address: $0030 bit 7654321bit 0 read: adpu csel irqe dly cme fcme cr1 cr0 write: reset:00010000 figure 5-4. system configuration options register (option) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 112 resets and interrupts motorola resets and interrupts 5.3.4.2 system configuration options register 2 lirdv ? lir driven bit this bit allows power savings in expanded modes by turning off the lir output (it has no meaning in single-chip or bootstrap modes). the lir pin is driven low to indicate that execution of an instruction has begun. to detect consecutive instructions in a high-speed application, this signal drives high for a quarter of a cycle to prevent false triggering. an external pullup is required in expanded modes, while a hardwired v ss connection is possible in single-chip modes. lirdv is reset to 0 in single-chip modes and to 1 in expanded modes. 1 = enable lir push-pull drive 0 = lir not driven high on moda/lir pin cwom ? port c wired-or mode bit for detailed information, refer to section 6. parallel input/output . 1 = port c outputs are open drain. 0 = port c operates normally. strch ? stretch external accesses bit when this bit is set, off-chip accesses of selected addresses are extended by one e-clock cycle to allow access to slow peripherals. the e clock stretches externally, but the internal clocks are not affected, so that timers and serial systems are not corrupted. the state of the romad bit in the config register determines which address range is affected. 1 = off-chip accesses are selectively extended by one e-clock cycle. 0 = normal operation address: $0038 bit 7654321bit 0 read: lirdv cwom strch (1) irvne lsbf spr2 xdv1 xdv0 write: reset: 0 0 0 ? 0000 1. not available on m68hc11k devices figure 5-5. system configuration options register 2 (opt2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts sources of resets m68hc11k family technical data motorola resets and interrupts 113 note: strch is cleared on reset; therefore, a program cannot execute out of reset in a slow external rom. to use the strch feature, romon must be set on reset so that the device starts with internal rom included in the memory map. strch should then be set. strch has no effect in single-chip and bootstrap modes. note: strch is not available on m68hc11k devices. irvne ? internal read visibility/not e bit irvne can be written once in any user mode. in expanded modes, irvne determines whether irv is on or off (but has no meaning in user expanded secure mode, as irv must be disabled). in special test mode, irvne is reset to 1. in normal modes, irvne is reset to 0. 1 = data from internal reads is driven out of the external data bus. 0 = no visibility of internal reads on external bus in single-chip modes, this bit determines whether the e clock drives out from the chip. 1 = e pin is driven low. 0 = e clock is driven out from the chip. refer to table 5-3 for a summary of the operation immediately following reset. table 5-3. irvne operation after reset mode irvne after reset e clock after reset irv after reset irvne affects only irvne can be written single-chip 0 on off e once expanded 0 on off irv once bootstrap 0 on off e unlimited special test 1 on on irv unlimited f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 114 resets and interrupts motorola resets and interrupts lsbf ? least significant bit (lsb) first enable bit for detailed information, refer to section 8. serial peripheral interface (spi) . 1 = data is transferred lsb first. 0 = data is transferred msb (most significant bit) first. spr2 ? spi clock rate selected bit this bit adds a divide-by-four to the spi clock chain. for detailed information, refer to section 8. serial peripheral interface (spi) . xdv[1:0] ? xout clock divide select bits these bits control the frequency of the clock driven out of the xout pin, if enabled by the clkx bit on the config register. see table 5-4 table 5-4. xout clock divide select xdv [1:0] xout = extal divided by frequency at extal = 8 mhz frequency at extal = 12 mhz frequency at extal = 16 mhz 0 0 1 8 mhz 12 mhz 16 mhz 01 4 2 mhz3 mhz4 mhz 1 0 6 1.3 mhz 2 mhz 2.7 mhz 1 1 8 1 mhz 1.5 mhz 2 mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts effects of reset m68hc11k family technical data motorola resets and interrupts 115 5.4 effects of reset when the mcu recognizes a reset condition, it forces the cpu registers and control bits to established initial states. these in turn force the on-chip peripheral systems to known startup states, as described here.  central processor unit (cpu) ? the stack pointer and other cpu registers are indeterminate immediately after reset, except for three bits in the condition code register (ccr). ? the x and i interrupt mask bits are set to mask any interrupt requests, and the s bit in the ccr is set to inhibit the stop mode.  memory map ? the init register is initialized to $00, putting the control registers at locations $0000 ? $007f. ? the 1.5 kbytes of ram are at locations $0080 ? $067f except for the m68hc11ks family, which has 1 kbytes of ram at locations $0080 ? $047f. ? the init2 register is $00, locating the eeprom at $0d80 ? $0fff.  timer ? the timing system is initialized to a count of $0000. ? the prescaler bits are cleared, and all output compare registers are initialized to $ffff. ? all input capture registers are indeterminate after reset. ? the output compare 1 mask (oc1m) register is cleared so that successful oc1 compares do not affect any input/output (i/o) pins. the other four output compares are configured so that they do not affect any i/o pins on successful compares. ? all input capture edge-detector circuits are configured for capture disabled operation. ? the timer overflow interrupt flag and all eight timer function interrupt flags are cleared. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 116 resets and interrupts motorola resets and interrupts ? all nine timer interrupts are disabled because their mask bits have been cleared. ? the i4/o5 bit in the pactl register is cleared to configure the i4/o5 function as oc5; however, the om5:ol5 control bits in the tctl1 register are clear so oc5 does not control the pa3 pin.  real-time interrupt (rti) ? the rti enable bit in tmsk2 is cleared, masking automatic hardware interrupts. ? the rate control bits are cleared after reset and can be initialized by software before the rti system is enabled.  pulse accumulator ? the pulse accumulator system is disabled at reset. ? the pai input pin defaults to a general-purpose input pin (pa7).  computer operating properly (cop) watchdog system ? the cop watchdog system is enabled if the nocop control bit in the config register is clear and disabled if nocop is set. ? the option register ? s cr[1:0] bits are cleared, setting the cop rate for the shortest duration timeout.  serial communications interface (sci) ? at reset, the sci baud rate control register ( 7.9.1 sci baud rate control register ) is initialized to $0004. ? all transmit and receive interrupts are masked and both the transmitter and receiver are disabled so the port pins default to being general-purpose i/o lines. ? the sci frame format is initialized to an 8-bit character size. ? the send break and receiver wake-up functions are disabled. ? the tdre and tc status bits in the sci status register are both set, indicating that there is no transmit data in either the transmit data register or the transmit serial shift register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts interrupts m68hc11k family technical data motorola resets and interrupts 117 ? the rdrf, idle, or, nf, fe, pf, and raf receive-related status bits are cleared.  serial peripheral interface (spi) ? the spi system is disabled by reset. ? the port pins associated with this function default to being general-purpose i/o lines.  analog-to-digital (a/d) converter ? the adpu bit in the option register is cleared, disabling the a/d system. ? the conversion complete flag in the adctl register is also cleared.  system ? the external irq pin has the highest i-bit interrupt priority because psel[4:0] in the hprio register are initialized with the value %00110 (where % indicates a binary value). ? the rboot, smod, and mda bits in the hprio register reflect the status of the modb and moda inputs at the rising edge of reset. ? the irq pin is configured for level-sensitive operation for wired-or systems. ? the dly control bit in the option register is set, enabling oscillator startup delay after recovery from stop mode. ? the clock monitor system is disabled because the cme and fcme bits in the option register are cleared. 5.5 interrupts the mcu has 18 interrupt vectors that support 22 interrupt sources. the 19 maskable interrupts are generated by on-chip peripheral systems. they are recognized when the i bit in the ccr is clear. the three non-maskable interrupt sources are illegal opcode trap, software interrupt, and xirq pin. table 5-5 lists the interrupt sources and vector assignments for each source. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 118 resets and interrupts motorola resets and interrupts table 5-5. interrupt and reset vector assignments vector address interrupt source cc register mask local mask ffc0, c1 ? ffd4, d5 reserved ?? ffd6, d7 sci serial system: ? ? ? ? ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts interrupts m68hc11k family technical data motorola resets and interrupts 119 many interrupt sources set associated flag bits when interrupts occur. these flags are usually cleared during the course of normal interrupt service. for example, the normal response to an rdrf interrupt request in the sci is to read the sci status register to check for receive errors, then read the received data from the sci data register. it is precisely these two steps which clear rdrf, so no extra steps are required. an interrupt can be recognized at any time after it is enabled by its local mask, if any, and by the global mask bit in the ccr. the cpu responds to an interrupt at the completion of the instruction being executed. since the number of clock cycles in the instruction varies, so does interrupt latency. the cpu pushes the contents of its registers onto the stack in the order shown in table 5-6 . after the ccr value is stacked, the i bit is set (and the x bit as well if xirq is pending) to inhibit further interrupts. the cpu fetches the interrupt vector for the highest priority pending source, and execution continues at the address specified by the vector. the interrupt service routine ends with the return-from-interrupt (rti) instruction, which tells the cpu to pull the saved registers from the stack in reverse order so that normal program execution can resume. table 5-6. stacking order on entry to interrupts memory location cpu registers sp pcl sp ? 1pch sp ? 2iyl sp ? 3iyh sp ? 4ixl sp ? 5ixh sp ? 6 acca sp ? 7 accb sp ? 8 ccr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 120 resets and interrupts motorola resets and interrupts 5.5.1 non-maskable interrupts non-maskable interrupts can interrupt cpu operations at any time. the most common use for such an interrupt is for serious system problems, such as program runaway or power failure. the three sources of non-maskable interrupt are:  xirq pin  illegal opcode trap  software interrupt instruction (swi) 5.5.1.1 non-maskable interrupt request (xirq ) the xirq input is an updated version of the non-maskable nmi input of earlier mcus. upon reset, both the x bit and i bit of the ccr are set to inhibit all maskable interrupts and xirq . after minimum system initialization, software can clear the x bit by a transfer from accumulator a to condition code register (tap) instruction, enabling xirq interrupts. thereafter, software cannot set the x bit and the xirq interrupt becomes non-maskable. i bit-related interrupts do not affect the x bit, which has a higher priority than they do in the interrupt priority logic. when an i bit-related interrupt occurs, the cpu sets the i bit after stacking the ccr byte, but the x bit remains unaffected. when an x bit-related interrupt occurs, the cpu sets both the x and i bits after stacking the ccr. the rti instruction restores the x and i bits to their pre-interrupt request state when it pulls the ccr from the stack. 5.5.1.2 illegal opcode trap the mcu includes an illegal opcode detection circuit to avoid attempting to process undefined opcodes or opcode sequences. this mechanism works for all unimplemented opcodes on all four opcode map pages. when the circuit detects an illegal opcode, it generates an interrupt. the cpu responds by pushing the current value of the program counter, which is actually the address of the first byte of the illegal opcode, on the stack. the illegal opcode service routine can use this stacked address as a pointer to the illegal opcode to correct it. to avoid repeated f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts interrupts m68hc11k family technical data motorola resets and interrupts 121 execution of the illegal opcode, which can lead to stack overflow, the service routine should reinitialize the stack pointer. 5.5.1.3 software interrupt (swi) swi cannot be masked by virtue of the fact that it is a software instruction. it is not inhibited by the global mask bits in the ccr. execution of swi sets the i mask bit, so other interrupts are inhibited until user software clears the i bit or swi terminates with an rti instruction. 5.5.2 maskable interrupts all maskable interrupts are generated by on-chip peripherals, with the exception of the irq pin. this input can be connected through a wired-or network to external devices. when one of these devices pulls irq low, a software accessible interrupt flag is set. when enabled, this flag causes a constant request for interrupt service. after the flag is cleared, the service request is released. irq is low-level sensitive by default, but can be set for falling-edge sensitivity by the irqe bit in the option register (see figure 5-6 ). irqe ? configure irq for edge-sensitive operation bit this bit can be written only once during the first 64 e-clock cycles after reset in normal modes. 0 = low-level recognition 1 = falling-edge recognition address: $0039 bit 7654321bit 0 read: adpu csel irqe (1) dly (1) cme fcme (1) cr1 (1) cr0 (1) write: reset:00010000 1. can be written only once in first 64 cycles out of reset in normal modes or at any time in special modes figure 5-6. system configuration options register (option) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 122 resets and interrupts motorola resets and interrupts 5.6 reset and interrupt priority a hardware priority scheme determines which reset or interrupt is serviced first when simultaneous requests occur. the six highest-priority interrupt sources are not maskable. the priority arrangement for these sources is: 1. por or reset pin 2. clock monitor reset 3. cop watchdog reset 4. xirq interrupt 5. illegal opcode interrupt 6. software interrupt (swi) the maskable interrupt sources have this priority arrangement: 1. irq 2. real-time interrupt 3. timer input capture 1 4. timer input capture 2 5. timer input capture 3 6. timer output compare 1 7. timer output compare 2 8. timer output compare 3 9. timer output compare 4 10. timer input capture 4/output compare 5 11. timer overflow 12. pulse accumulator overflow 13. pulse accumulator input edge 14. spi transfer complete 15. sci system f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt processing m68hc11k family technical data motorola resets and interrupts 123 any single maskable interrupt can be given priority over other maskable interrupts by writing the appropriate value to the psel bits in the hprio register (see figure 5-7 ). an interrupt that is assigned highest priority is still subject to global masking by the i bit in the ccr or by any associated local bits. interrupt vectors are not affected by priority assignment. note: to avoid race conditions, hprio is designed so that bits psel[4:0] can be written only while the i-bit is set (interrupts are inhibited). psel[4:0] ? priority select bits these bits select one interrupt source to have the highest priority, as explained in table 5-7 . 5.7 reset and interrupt processing this section presents flow diagrams of the reset and interrupt processes. figure 5-8 illustrates how the cpu begins from a reset and how interrupt detection relates to normal opcode fetches. figure 5-9 is an expansion of a block in figure 5-8 and illustrates interrupt priorities. figure 5-10 shows the resolution of interrupt sources within the sci subsystem. address: $003c bit 7654321bit 0 read: rboot smod mda psel4 psel3 psel2 psel1 psel0 write: reset:00000110 figure 5-7. highest priority i-bit interrupt and miscellaneous register (hprio) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 124 resets and interrupts motorola resets and interrupts table 5-7. highest priority interrupt selection pselx interrupt source promoted 43210 0 0 0 x x reserved (default to irq ) 00100reserved (default to irq ) 00101reserved (default to irq ) 00110irq 00111real-time interrupt 01000timer input capture 1 01001timer input capture 2 01010timer input capture 3 01011timer output compare 1 01100timer output compare 2 01101timer output compare 3 01110timer output compare 4 01111timer output compare 5/i nput capture 4 10000timer overflow 10001pulse accumulator overflow 10010pulse accumulator i nput edge 10011spi serial transfer complete 10100sci serial system 10101reserved (default to irq ) 10110reserved (default to irq ) 10111reserved (default to irq ) 1 1 x x x reserved (default to irq ) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt processing m68hc11k family technical data motorola resets and interrupts 125 figure 5-8. processing flow out of reset (sheet 1 of 2) 2a bit x in y n xirq y n pin low? ccr = 1? begin instruction sequence 1a stack cpu registers set bits i and x fetch vector $fff4, $fff5 set bits s, i, and x reset mcu hardware power-on reset (por) external reset clock monitor fail (with cme = 1) cop watchdog timeout (with nocop = 0) delay 4064 e cycles load program counter with contents of $fffe, $ffff (vector fetch) load program counter with contents of $fffc, $fffd (vector fetch) load program counter with contents of $fffa, $fffb (vector fetch) highest priority lowest priority f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 126 resets and interrupts motorola resets and interrupts figure 5-8. processing flow out of reset (sheet 2 of 2) bit i in ccr = 1? 2a y n any i-bit interrupt y n pending? fetch opcode illegal opcode? y n wai y n instruction? swi instruction? y n rti instruction? y n execute this instruction stack cpu registers any n y interrupt pending? set bit i in ccr resolve interrupt priority and fetch vector for highest pending source stack cpu registers set bit i in ccr fetch vector $fff8, $fff9 stack cpu registers set bit i in ccr fetch vector $fff6, $fff7 restore cpu registers from stack 1a stack cpu registers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts reset and interrupt processing m68hc11k family technical data motorola resets and interrupts 127 figure 5-9. interrupt priority resolution (sheet 1 of 2) 2a begin set x bit in ccr fetch vector $fff4, fff5 x bit in ccr set ? yes no xirq pin low ? yes no highest priority interrupt ? yes no irq ? yes no fetch vector $fff2, fff3 fetch vector $fff0, fff1 rtii = 1 ? yes no real-time interrupt ? yes no fetch vector $ffee, ffef ic1i = 1 ? yes no timer ic1f ? yes no fetch vector $ffec, ffed ic2i = 1 ? yes no timer ic2f ? yes no fetch vector $ffea, ffeb ic3i = 1 ? yes no timer ic3f ? yes no fetch vector $ffe8, ffe9 oc1i = 1 ? yes no timer oc1f ? yes no 2b fetch vector f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 128 resets and interrupts motorola resets and interrupts figure 5-9. interrupt priority resolution (sheet 2 of 2) toi = 1? y n y n paovi = 1? paii = 1? y n spie = 1? y n y n flag y n y n flag flag y n flags y n paif = 1? spif = 1? or tof = 1? paovf = 1 fetch vector $ffde, $ffdf fetch vector $ffdc, $ffdd fetch vector $ffda, $ffdb fetch vector $ffd6, $ffd7 fetch vector $ffd8, $ffd9 oc2i = 1? y n y n oc3i = 1? oc4i = 1? y n oc5i = 1? y n flag y n y n flag flag y n flag y n oc4f = 1? oc5f = 1? oc2f = 1? oc3f = 1 fetch vector $ffe6, $ffe7 fetch vector $ffe4, $ffe5 fetch vector $ffe2, $ffe3 fetch vector $ffe0, $ffe1 modf = 1? interrupt? 2a 2b end fetch vector $fff2, $fff3 sci f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low-power operation m68hc11k family technical data motorola resets and interrupts 129 figure 5-10. interrupt priority resolution within sci system 5.8 low-power operation the mcu contains two software instructions, wait and stop, to reduce power consumption when processing is not required. both instructions suspend operation until a reset or interrupt occurs while retaining register and ram contents. the wait condition suspends processing, reducing power consumption to an intermediate level. the stop condition turns off all on-chip clocks as well and reduces power consumption to an absolute minimum. flag y n or = 1? y n y n tdre = 1? tc = 1? y n idle = 1? y n y n y n y n ilie = 1? rie = 1? tie = 1? begin re = 1? y n y n te = 1? tcie = 1? y n re = 1? y n rdrf = 1? valid sci request no valid sci request f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 130 resets and interrupts motorola resets and interrupts 5.8.1 wait mode the wai opcode places the mcu in the wait condition, during which the cpu registers are stacked and cpu processing is suspended until a qualified interrupt is detected. the interrupt can be an external irq , an xirq , or any of the internally generated interrupts, such as the timer or serial interrupts. the on-chip crystal oscillator remains active throughout the wait standby period. the reduction of power in the wait condition depends on how many internal clock signals driving on-chip peripheral functions can be shut down. the cpu is always shut down during wait. while in the wait state, the address/data bus repeatedly runs read cycles to the address where the ccr contents were stacked. the mcu leaves the wait state when it senses any interrupt that has not been masked. the free-running timer system is shut down only if maskable interrupts are disabled (i bit is set) and the cop system is disabled (nocop is set). other systems can be shut down through the software-controlled configuration control bits, including the spi system (spe control bit), the sci transmitter (te bit), and the sci receiver (re bit). net power reduction in wait depends on which of these features is disabled. 5.8.2 stop mode the stop instruction halts all system clocks, including the crystal oscillator, thereby minimizing power consumption. the s bit in the ccr must be cleared to place the mcu in the stop condition; otherwise, the stop opcode is treated as a no-operation (nop). to exit stop and resume normal processing, a logic low level must be applied to one of the external interrupt pins (irq or xirq ) or to the reset pin. a pending edge-triggered irq can also bring the cpu out of stop. because all clocks are stopped in this mode, all internal peripheral functions also stop. ram and register contents are preserved as long as v dd power is maintained. the cpu state and i/o pin levels are static and are not altered by stop, so the mcu resumes processing seamlessly after the system is reactivated by an interrupt. however, if a reset is used f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low-power operation m68hc11k family technical data motorola resets and interrupts 131 to restart the system, a normal reset sequence results and all pins and registers are reinitialized. to use the irq pin as a means of recovering from stop, the i bit in the ccr must be clear (irq not masked). the xirq pin can be used to wake up the mcu from stop regardless of the state of the x bit in the ccr, although the state of this bit does affect the recovery sequence. if x is clear (xirq not masked), the mcu executes a normal xirq service routine. if x is set (xirq masked or inhibited), then processing continues with the instruction that immediately follows the stop instruction, and no xirq interrupt service is requested or pending. executing a stop instruction requires special consideration when the clock monitor is enabled. because the stop function halts all clocks, the clock monitor function will generate a reset sequence if it is enabled at the time the stop mode was initiated. to prevent this, clear the cme and fcme bits in the option register before executing a stop instruction to disable the clock monitor. after recovery from stop, set the cme bit to enable the clock monitor. systems using the internal oscillator require a delay after restart upon leaving stop to allow the oscillator to stabilize. if a stable external oscillator is used, the dly control bit in the option register can be used to bypass this startup delay (see figure 5-11 ). reset sets the dly control bit; it can be cleared during initialization. do not use reset to recover from stop if the dly is to be bypassed, since reset sets the dly bit again, causing the restart delay. this same delay will follow a power-on reset, regardless of the state of the dly control bit, but does not apply to a reset while the clocks are running. address: $0039 bit 7654321bit 0 read: adple dsel irqe (1) dly (1) cme fcme (1) cr1 (1) cr0 (1) write: reset:00010000 1. can be written only once in first 64 cycles out of reset in normal modes or at any time in special modes figure 5-11. system configuration options register (option) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 132 resets and interrupts motorola resets and interrupts dly ? enable oscillator startup delay bit this bit is set during reset and can be written only once during the first 64 e-clock cycles after reset in normal modes. this bit can be used to inhibit the oscillator startup delay after reset when using an external clock source. 0 = no stabilization delay on exit from stop 1 = stabilization delay enabled on exit from stop 5.8.3 slow mode slow mode is a software selectable feature on m68hc(7)11ks devices that allows the user to connect, under software control, an extra divide-by-16 between the oscillator and the internal clock. this feature permits a slow down of all the internal operations reducing power consumption. when wai is used for power reduction, the slow mode helps further reduce the power. control of slow mode is performed in the system configuration options 3 register (opt3). see figure 5-12 . sm ? slow-mode enable bit read and write at any time 1 = when the sm bit is asserted, a 16-clock divider is connected between the oscillator and the internal clock. this causes the system clock to run 16 times slower than normal. all modules of the mcu slow down, including the timer, sci, spi, and a/d. it is also cleared in hardware when entering stop mode or when reset, including por, is asserted low. 0 = when the sm bit is negated, the divider is disconnected and the system runs at normal bus speed. address: $002e bit 7654321bit 0 read: sm write: reset:00000000 figure 5-12. system configuration options 3 register (opt3) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets and interrupts low-power operation m68hc11k family technical data motorola resets and interrupts 133 note: the slow mode function should not be enabled while using the a/d converter or during an erase/program operation of the eeprom, unless the internal rc oscillator is turned on. the clock monitor function should not be used if the resultant e clock will be slower than 200 khz. figure 5-13. slow mode example for m68hc(7)11ks devices only extal xtal oscillator sm bit control logic sci & xout circuits cpu & other modules divide by 4 mux xtal divide by 16 immediate change sm to 1 requires low/hi/low on xtal ? divide by 16 resets ? mux-out low 8 cycles ? divide by 16 high 8 cycles ? divide by 16 low mux divide by 16 to system f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 134 resets and interrupts motorola resets and interrupts f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola parallel input/output 135 technical data ? m68hc11k family section 6. parallel input/output 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136 6.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 6.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 6.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 6.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142 6.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 6.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 6.9 port g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 6.10 port h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 6.11 internal pullup resistors. . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 136 parallel input/output motorola parallel input/output 6.2 introduction the m68hc11k series mcus contain eight input/output (i/o) ports, a through h. all ports can provide general-purpose i/o (gpio) as well as their specialized functions, as explained in 2.11 port signals and summarized in table 6-1 . each of the ports has an associated data register (portx). each port, except port e, also has an associated data direction register (ddrx). when a port is configured for gpio, its ddr determines whether port pins function as inputs or outputs. a port ? s special functions override the ddr when they are enabled. writes to any port, except port e, are stored in internal latches. the latches drive the port pins only when they are configured as general-purpose outputs. when software reads a port pin configured for gpio, the mcu returns the physical pin level, not the port register value. this applies to both inputs and outputs. the only exception applies to ports c and d in wired-or mode. when they are configured as outputs, a read returns the pin driver levels. table 6-1. port configuration port input pins output pins bidirectional pins shared functions port a ?? 8timer port b ?? 8 high-order address port c ?? 8 data bus port d ?? 6 sci and spi port e 8 ?? a/d converter port f ?? 8 low-order address port g ?? 8 (1) 1. ks devices do not contain port g[6:0], so they have only one bidirectional pin on this port. memory expansion port h ?? 8 (2) 2. ks devices do not contain port h[7:4], so they have only four bidirectional pins on this port. chip selects and pwm f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output introduction m68hc11k family technical data motorola parallel input/output 137 ports b, f, g, and h contain on-chip pullup devices which are enabled by the port pullup assignment register (ppar) described in 6.11 internal pullup resistors . at reset, the ports are configured as high-impedance gpio inputs (except for ports b, c, f, and port g pin 7 in expanded modes). the contents of the data latches is undefined. if any of the bidirectional pins are changed to outputs before writing to the associated data registers, the undefined contents will be driven on the pins. this is indicated by the letter u in the register descriptions that follow. note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 138 parallel input/output motorola parallel input/output 6.3 port a port a provides the i/o lines for the timer functions and pulse accumulator. the eight port a bits (pa[7:0]) are configured as high-impedance general-purpose inputs out of reset. writes to ddra can change any of the bits to outputs. writes to timer registers enable the various timer functions (see section 9. timing system ). dda[7:0] ? data direction for port a bits 0 = input 1 = output address: $0000 bit 7654321bit 0 read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: undefined after reset alternate pin function: pai oc2 oc3 oc4 ic4/oc5 ic1 ic2 ic3 and/or: oc1 oc1 oc1 oc1 oc1 ??? figure 6-1. port a data register (porta) address: $0001 bit 7654321bit 0 read: dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 write: reset:00000000 figure 6-2. port a data direction register (ddra) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port b m68hc11k family technical data motorola parallel input/output 139 6.4 port b the state of port b (pb[7:0]) at reset is mode dependent. in single-chip or bootstrap modes, port b pins are high-impedance inputs with selectable internal pullup resistors (see 6.11 internal pullup resistors ). writes to ddrb can change any of the bits to outputs. in expanded or test modes, port b pins provide the high-order address lines addr[15:8] for external memory devices. ddb[7:0] ? data direction for port b bits 0 = input 1 = output address: $0004 bit 7654321bit 0 read: pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 write: reset: undefined after reset single-chip/boot: pb7i pb6 pb5 pb4 pb3 pb2 pb1 pb0 expanded/test: addr15 addr14 addr13 addr12 addr11 addr10 addr9 addr8 figure 6-3. port b data register (portb) address: $0002 bit 7654321bit 0 read: ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 write: reset:00000000 figure 6-4. port b data direction register (ddrb) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 140 parallel input/output motorola parallel input/output 6.5 port c the state of port c at reset is mode dependent. in single-chip or bootstrap modes, port c pins (pc[7:0]) are high-impedance inputs. writes to ddrc can change any of the bits to outputs. in expanded or test modes, port c pins provide the data lines (data[7:0]) for external memory devices. the mcu ? s internal data bus can also be driven on port c by setting the irvne bit in the system configuration options register (opt2). see figure 6-7 . when port c functions as gpio (single-chip mode), it can be configured for wired-or operation by setting the cwom bit in the opt2 register. this disables port c ? s p-channel drivers, effectively generating open-drain-type outputs. to output a logic 0 on a wired-or pin, the mcu turns on its n-channel driver. to generate a logic 1, both p- and n-channel drivers are turned off, presenting a high-impedance state which requires an external pullup resistor to apply the appropriate voltage level. address: $0006 bit 7654321bit 0 read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: undefined after reset single-chip/boot: pc7i pc6 pc5 pc4 pc3 pc2 pc1 pc0 expanded/test: data7 data6 data5 data4 data3 data2 data1 data0 figure 6-5. port c data register (portc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port c m68hc11k family technical data motorola parallel input/output 141 ddc[7:0] ? data direction for port c bits 0 = input 1 = output cwom ? port c wired-or mode bit 0 = port c operates normally. 1 = port c outputs are open drain. irvne ? internal read visibility/not e bit in expanded modes, setting this bit drives mcu ? s internal data bus on port c. 0 = no internal read visibility on external data bus 1 = data from internal reads is driven on port c. in single-chip modes, setting this bit inhibits the e clock driver, and the e pin is pulled low 0 = e clock drives the e pin. 1 = e pin is driven low. note: irvne can be written only once after reset. the default value of irvne after reset is low. address: $0007 bit 7654321bit 0 read: ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 write: reset:00000000 figure 6-6. port c data direction register (ddrc) address: $0038 bit 7654321bit 0 read: lirdv cwom strch (1) irvne lsbf spr2 xdv1 xdv0 write: reset: 0 0 0 ? 0000 1. not available on ks devices figure 6-7. system configuration options 2 register (opt2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 142 parallel input/output motorola parallel input/output 6.6 port d the six port d bits, pd[5:0] function as the serial communication interface (see section 7. serial communications interface (sci) ) and the serial peripheral interface (see section 8. serial peripheral interface (spi) ) when these functions are enabled by software. they are high-impedance general-purpose inputs out of reset; ddrd can be used to change any of the pins to outputs. ddd[5:0] ? data direction for port d bits 0 = input 1 = output address: $0008 bit 7654321bit 0 read: 0 0 pd5 pd4 pd3 pd2 pd1 pd0 write: reset:0 0uuuuuu alternate pin function: ?? ss sck mosi miso txd rxd u = undefined figure 6-8. port d data register (portd) address: $0009 bit 7654321bit 0 read: 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 write: reset:00000000 figure 6-9. port d data direction register (ddrd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port e m68hc11k family technical data motorola parallel input/output 143 6.7 port e port e, pe[7:0], is the only port that functions as input only, and its pins are configured as high-impedance inputs out of reset. it also serves as the analog input for the analog-to-digital converter when this function is enabled by software (see section 10. analog-to-digital (a/d) converter ). note: port e should not be read during the sample portion of an a/d conversion. address: $000a bit 7654321bit 0 read: pe7 pe6 pe5 pe4 pe3 pe2 pd1 pd0 write: reset: undefined after reset alternate pin function: an7 an6 an5 an4 an3 an2 an1 an0 figure 6-10. port e data register (porte) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 144 parallel input/output motorola parallel input/output 6.8 port f the state of port f (pf[7:0]) at reset is mode dependent. in single-chip or bootstrap modes, port f pins are high-impedance inputs with selectable internal pullup resistors (see 6.11 internal pullup resistors ). writes to ddrf can change any of the bits to outputs. in expanded or test modes, port f pins provide low-order address lines, addr[7:0], for external memory devices. ddf[7:0] ? data direction for port f bits 0 = input 1 = output address: $0005 bit 7654321bit 0 read: pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 write: reset: undefined after reset single-chip/boot: pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 expanded/test: an7 an6 an5 an4 an3 an2 an1 an0 figure 6-11. port f data register (portf) address: $0003 bit 7654321bit 0 read: ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 write: reset:00000000 figure 6-12. port f data direction register (ddrf) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output port g m68hc11k family technical data motorola parallel input/output 145 6.9 port g the state of port g pin 7 (pg7) at reset is mode dependent. in single-chip or bootstrap modes, it is a high-impedance input; its data direction can be changed through ddrg. in expanded and special test modes, pg7 functions as the r/w line to control the direction of data flow between the mcu and external memory devices. port g pins (pg[6:0]) reset to high-impedance inputs in any mode. data direction can be changed through ddrg. port g bits [5:0] can serve as memory expansion address lines (see 11.3 memory expansion ) in expanded and special test modes. m68hc11ks devices do not contain these pins. all eight port g pins have selectable internal pullup resistors (see 6.11 internal pullup resistors ). ddg[7:0] ? data direction for port g bits 0 = input 1 = output address: $007e bit 7654321bit 0 read: pg7 pg6 (1) pg5 (1) pg4 (1) pg3 (1) pg2 (1) pg1 (1) pg0 (1) write: reset:00000000 alternate pin function: r/w ? xa18 xa17 xa16 xa15 xa14 xa13 1. not available on ks devices figure 6-13. port g data register (portg) address: $007f bit 7654321bit 0 read: ddg7 ddg6 (1) ddg5 (1) ddg4 (1) ddg3 (1) ddg2 (1) ddg1 (1) ddg0 (1) write: reset:00000000 1. not available on ks devices figure 6-14. port g data direction register (ddrg) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 146 parallel input/output motorola parallel input/output 6.10 port h the state of port h pin 7 (ph7) at reset is mode dependent. in single-chip or bootstrap modes, it is a high-impedance input; its data direction can be changed through ddrh. in expanded and special test modes ph7 is the program chip select line, csprog at reset, but can be reconfigured for gpio (see 11.4 chip selects ). port h pins (ph[6:0]) reset to high-impedance inputs in any mode. data direction can be changed through ddrh. except for the m68hc11ks devices, bits 6:4 can serve as chip select lines in expanded and special test modes (see 11.4 chip selects ). pins 3:0 can be configured as pulse-width modulator outputs (see 9.9 pulse-width modulator (pwm) ) in any mode. all eight port h pins have selectable internal pullup resistors (see 6.11 internal pullup resistors ). ddh[7:0] ? data direction for port h bits 0 = input 1 = output address: $007c bit 7654321bit 0 read: ph7 (1) ph6 (1) ph5 (1) ph4 (1) ph3 ph2 ph1 ph0 write: reset:00000000 alternate pin function: csprog cspg2 cspg1 csio pw4 ps3 ps2 ps1 1. not available on ks devices figure 6-15. port h data register (porth) address: $007d bit 7654321bit 0 read: ddh7 (1) ddh6 (1) ddh5 (1) ddh4 (1) ddh3 ddh2 ddh1 ddh0 write: reset:00000000 1. not available on ks devices figure 6-16. port h data direction register (ddrh) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
parallel input/output internal pullup resistors m68hc11k family technical data motorola parallel input/output 147 6.11 internal pullup resistors m68hc11ks series devices contain selectable internal pullup resistors for ports b, f, g, and h. the resistors for each port are enabled by setting the corresponding bit in the ppar register. ppar itself must be enabled by setting the paren bit in the system configuration register (config). refer to figure 6-17 and figure 6-18 . xppue ? port x pin pullup enable bits only active when enabled by the paren bit in the config register 0 = port x pin on-chip pullup devices disabled 1 = port x pin on-chip pullup devices enabled note: fppue and bppue do not apply in expanded mode because port f and b are address outputs. note: config is writable once in normal modes and writable at any time in special modes. paren ? pullup assignment register enable bit 0 = ppar register disabled 1 = ppar register enabled; pullups can be enabled through ppar address: $002c bit 7654321bit 0 read: 0 0 0 0 hppue gppue fppue bppue write: reset:00001111 figure 6-17. port pullup assignment register (ppar) address: $003f bit 7654321bit 0 read: romad 1 clkx paren nosec nocop romon eeon write: reset: ? 1 ?? 1 ??? figure 6-18. system configuration register (config) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 148 parallel input/output motorola parallel input/output f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola serial communications interface (sci) 149 technical data ? m68hc11k family section 7. serial communications interface (sci) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 7.3 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 7.4 transmit operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 7.5 receive operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 7.6 wakeup feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 7.7 short mode idle line detection . . . . . . . . . . . . . . . . . . . . . . .157 7.8 baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 7.9 sci registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 7.9.1 sci baud rate control register . . . . . . . . . . . . . . . . . . . .158 7.9.2 serial communications control register 1 . . . . . . . . . . . .160 7.9.3 serial communications control register 2 . . . . . . . . . . . .161 7.9.4 serial communication status register 1 . . . . . . . . . . . . . .162 7.9.5 serial communication status register 2 . . . . . . . . . . . . . .164 7.9.6 serial communications data register . . . . . . . . . . . . . . . .165 7.2 introduction the serial communications interface (sci) is a universal asynchronous receiver transmitter (uart) employing a standard non-return-to-zero (nrz) format. several baud rates are available. the sci transmitter and receiver are independent, but they use the same data format and baud rate. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 150 serial communications interface (sci) motorola serial communications interface (sci) the m68hc11k series offers several enhancements to the basic mc68hc11 sci, including:  13-bit modulus prescaler in the baud generator  receiver-active flag  transmitter and receiver hardware parity  accelerated idle line detection 7.3 data format the sci uses the standard non-return to zero mark/space data format illustrated in figure 7-1 . figure 7-1. sci data formats data is transmitted in frames consisting of a start bit, a word of eight or nine data bits, and a stop bit. the step-by-step transmission procedure is: 1. the transmission line is idle before a message is transmitted. this means that the line is in a logic 1 state for at least one frame time. 2. a start bit, logic 0, is transmitted, indicating the start of a frame. 3. an 8-bit or 9-bit word is transmitted, least significant bit (lsb) first. 4. a stop bit, logic 1, is transmitted to indicate the end of a frame. 5. an optional number of breaks can be transmitted. a break is the transmission of a logic low state for one frame time. after the last break character is sent, the line goes high for at least one bit time. start bit bit 0 bit 2 bit 3 bit 1 bit 4 bit5 bit7 bit6 stop bit next start bit next start bit stop bit parity or data bit bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 start bit 9-bit data format (bit min scc1 set) 8-bit data format (bit min scc1 clear) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) transmit operation m68hc11k family technical data motorola serial communications interface (sci) 151 6. steps 2-5 are repeated until the entire message is sent. 7. the line returns to idle status. 7.4 transmit operation transmission starts by writing a data character to the 2-byte sci data register (scdrh and scdrl). the mcu parallel-loads the character into a serial shift register which shifts the data out on the transmission pin. this double-buffered operation allows transmission of the current character while the mcu loads the next one. the output of the serial shift register drives the txd pin as long as the transmit enable (te) bit of serial communication control register 2 (sccr2) is set. two flags in serial communication status register 1 (scsr1) alert the mcu of transmission status. the tdre (transmit data register empty) flag is set when the scdr loads its contents into the shift register; this flag can generate an interrupt if the tie (transmit interrupt enable) bit in sccr2 is set. the tc (transmit complete) flag is set when transmission is complete (line idle); this can also generate an interrupt if the tcie (transmit complete interrupt enable) bit in scsr1 is set. the tdre and tc flags are normally set when software sets the te bit to enable the transmitter. see figure 5-10. interrupt priority resolution within sci system for a flow diagram of sci interrupts. if interrupts are not enabled, the status flags can be read by software (polled) to determine when the corresponding conditions exist. status flags are set automatically by hardware logic conditions, but must be cleared by software. the software clearing sequence for these flags is automatic. functions that are normally performed in response to the status flags also satisfy the conditions of the clearing sequence. when software clears the te bit, the txd pin reverts to its general-purpose i/o function (pd1). the transmitter completes transmission of a character in progress before actually shutting down; other characters waiting in the transmit queue are lost. the tc and tdre flags are set at the completion of this last character, even though te has been disabled. only an mcu reset can abort transmission in midcharacter. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 152 serial communications interface (sci) motorola serial communications interface (sci) figure 7-2 is a block diagram of the sci transmitter. figure 7-2. sci transmitter block diagram tc tdre scsr1 sci status 1 sccr2 sci control 2 transmitter control logic tcie tc tie tdre sci rx requests sci interrupt request internal data bus pin buffer and control h 10 (11) ? bit tx shift register ddd1 (1) scdr tx buffer transfer tx buffer shift enable jam enable preamble ? jam 1s break ? jam 0s write only force pin direction (out) size 8/9 m sccr1 sci control 1 transmitter baud rate clock parity generator pe pt tie tcie tie te sbk 8 7 6 5 4 3 2 1 0 l pd1 txd note 1. data direction register for port d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) receive operation m68hc11k family technical data motorola serial communications interface (sci) 153 7.5 receive operation during receive operations, data from the txd pin is shifted into the serial shift register. a completed word is parallel-loaded to a receive data register (rdr), which can be read through scdrh/l. this double-buffered operation allows reception of the current character while the mcu reads the previous character. the sci receiver has seven status flags, summarized in table 7-1 . three of the flags can generate interrupt requests if the corresponding enable bits in sccr2 are set. the status flags are set by the sci logic in response to specific conditions in the receiver. these flags can be read (polled) at any time by software. each bit except raf is cleared by reading scsr1 and scdr sequentially.  the receive data register full (rdrf) flag is set when the last bit of a character is received and data is transferred from the shift register to the rdr.  the idle flag is set after a transition on the rxd line from an active state to an idle state. this prevents repeated interrupts during the time rxd remains idle. table 7-1. sci receiver flags flag name set when interrupt enable bit rdrf receive data register full character transferred from shift register to rdr rie idle idle-line detected active transmit line goes idle ilie or overrun error character ready for rdr while previous character unread rie nf noise error samples of data bit not unanimous ? fe frame error 0 detected where stop bit expected ? pf parity error calculated parity does not match data parity bit ? raf receiver active a character is being received ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 154 serial communications interface (sci) motorola serial communications interface (sci)  the overrun error (or) flag is set instead of the rdrf bit when the next byte is ready to be transferred from the receive shift register to the rdr and the rdr is already full. the data in the shift register is lost and the data that was already in rdr is not disturbed.  the noise flag (nf) is set if there is noise on any of the received bits, including the start and stop bits. the data recovery circuit takes three samples of each bit and indicates noise if any set of three samples is not unanimous. nf is not set until the entire character is received and transferred to the rdr, when rdrf is set.  the framing error (fe) flag is set when no stop bit is detected in the received data character. fe is set at the same time as rdrf. if the byte received causes both framing and overrun errors, the processor only recognizes the overrun error. the framing error flag inhibits further data transfer into the rdr until the flag is cleared.  the parity error (pe) flag indicates that the parity bit of a received character does not match the parity calculated by hardware.  the receiver active flag (raf) is a read-only bit that is set during data reception and cleared when the line goes idle. this is the only flag cleared by hardware. figure 7-3 is a block diagram of the sci receiver. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) receive operation m68hc11k family technical data motorola serial communications interface (sci) 155 figure 7-3. sci receiver block diagram scsr1 sci status 1 sccr2 sci control 2 sci rx requests sci interrupt request internal data bus h 10 (11) - bit m sccr1 sci control 1 receiver baud rate clock parity detect pe pt rie ilie 8 7 6 5 4 3 2 1 0 l pd0 rxd scdr rx buffer tx shift register ddd0 (1) pin buffer and control data recovery 16 stop start msb all ones re wakeup logic scsr2 sci status 2 raf rdrf idle or nf fe pf rwu disable driver wake ilt (read only) rdrf rie idle ilie or rie note 1. data direction register for port d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 156 serial communications interface (sci) motorola serial communications interface (sci) 7.6 wakeup feature the wakeup feature reduces sci service overhead in multiple receiver systems. if a system generates address information at the beginning of every message, each receiver can determine whether or not it is the intended recipient of a message by evaluating the first character(s) through software. if the message is intended for a different receiver, the sci can be placed in a sleep mode so that the rest of the message will not generate requests for service. it does this by setting the rwu (receiver wakeup) bit in sci control register 2 (sccr2), which inhibits all receiver-related status flags (rdrf, idle, or, nf, fe, pf, and raf). a new message clears the receiver ? s rwu bit, enabling it to evaluate the new address information. although rwu can be cleared by a software write to sccr2, this is rarely done because hardware clears rwu automatically. two methods of wakeup are available:  idle line wakeup ? a sleeping receiver wakes up as soon as the rxd line becomes idle (for example, in a logic 1 state for at least one frame time). a system using this type of wakeup must provide at least one character time of idle between messages to wake up sleeping receivers and must not allow any idle time between characters within a message.  address mark wakeup ? uses the most significant bit (msb) to distinguish address characters (msb = 1) from data characters (msb = 0). a sleeping receiver wakes up whenever it receives an address character. unlike the idle line method, address mark wakeup allows idle periods within messages and does not require idle time between messages. however, message processing is less efficient because the start bit of each character must be evaluated. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) short mode idle line detection m68hc11k family technical data motorola serial communications interface (sci) 157 7.7 short mode idle line detection this feature can increase system communication speed by reducing the amount of time between messages. setting the ilt bit in sccr1 allows the sci receiver to detect the consecutive 1s of an idle period before the stop bit of an incoming character is received. if the last few bits of the character are 1s, they are counted as the first high bits in the frame of 1s comprising the idle period following the character. note: extra care may be needed to prevent premature detection of an idle line condition. 7.8 baud rate selection the baud rate generator for the sci includes a 13-bit modulus prescaler driven by the system crystal clock (extal). writing to the sci baud rate register (scbdh/l) selects the prescaler value. see figure 7-4 . figure 7-4. sci baud generator circuit diagram 13-bit counter extal 13-bit compare scbdh/l sci baud rate 2 internal phase 2 clock synch 16 transmitter baud rate clock receiver baud rate clock reset control f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 158 serial communications interface (sci) motorola serial communications interface (sci) 7.9 sci registers the six addressable registers in the sci are:  sci baud rate control register (scbdh and scbdl)  serial communications control register 1 (sccr1)  serial communications control register 2 (sccr2)  serial communication status register 1 (scsr1)  serial communication status register 2 (scsr2)  serial communications data register (scdrh and scdrl) note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. 7.9.1 sci baud rate control register this register selects the 13-bit divisor shown in figure 7-4 to generate the sci baud rate. (see table 7-2 .) normally, this register is written once during initialization, but it can be changed at any time. address: $0070 bit 7654321bit 0 read: btst bspl 0 sbr12 sbr11 sbr10 sbr9 sbr8 write: reset:00000uuu u = undefined figure 7-5. sci baud rate control register high (scbdh) address: $0071 bit 7654321bit 0 read: sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 write: reset:00000uuu u = undefined figure 7-6. sci baud rate control register low (scbdl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers m68hc11k family technical data motorola serial communications interface (sci) 159 btst ? baud register test bit btst is for factory use only and is only accessible in special test mode. bspl ? baud rate counter split bit bsok is for factory use only and is only accessible in special test mode. sbr[12:0] ? sci baud rate select bits these bits represent the value br in: sci baud rate control register value = (extal/32)/target baud rate table 7-2. sci+ baud rates extal frequencies extal freq. 8.0 mhz 12.0 mhz 16.0 mhz 20.0 mhz 24.0 mhz e clock freq. 2.0 mhz 3.0 mhz 4.0 mhz 5.0 mhz 6.0 mhz target baud rate sci baud rate control register values decimal hex decimal hex decimal hex decimal hex decimal hex 110 baud 2273 $08e1 3409 $0d51 4545 $11c1 5682 $1632 6818 $1aa2 150 baud 1667 $0683 2500 $09c4 3333 $0d05 4167 $1047 5000 $1388 300 baud 833 $0341 1250 $04e2 1667 $0683 2083 $0823 2500 $09c4 600 baud 417 $01a1 625 $0271 833 $0341 1042 $0412 1250 $04e2 1200 baud 208 $00d0 313 $0139 417 $01a1 521 $0209 625 $0271 2400 baud 104 $0068 156 $009c 208 $00d0 260 $0104 313 $0139 4800 baud 52 $0034 78 $004e 104 $0068 130 $0082 156 $009c 9600 baud 26 $001a 39 $0027 52 $0034 65 $0041 78 $004e 19200 baud 13 $000d 20 $0014 26 $001a 33 $0021 39 $0027 38400 baud ???? 13 $000d 16 $0010 20 $0014 76800 baud ?????? 8 $0008 10 $000a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 160 serial communications interface (sci) motorola serial communications interface (sci) 7.9.2 serial communications control register 1 loops ? sci loop mode enable bit both the transmitter and receiver must be enabled to use the loop mode. when the loop mode is enabled, the txd pin is driven high (idle line state) if the transmitter is enabled. 0 = sci transmit and receive operate normally. 1 = sci transmit and receive are disconnected from txd and rxd pins, and transmitter output is fed back into the receiver input. woms ? wired-or mode for sci pins pd[1:0] bits see also 8.6.1 serial peripheral control register for a description of the dwom (port d wired-or mode) bit in the serial peripheral control register (spcr). 0 = txd and rxd operate normally. 1 = txd and rxd are open drains if operating as outputs. m ? mode (sci word size) bit 0 = start bit, 8 data bits, 1 stop bit 1 = start bit, 9 data bits, 1 stop bit wake ? wakeup mode bit 0 = wake up by idle line recognition 1 = wake up by address mark (most significant data bit set) ilt ? idle line type bit 0 = short (sci counts consecutive 1s after start bit.) 1 = long (sci counts one only after stop bit.) address $0072 bit 7654321bit 0 read: loops woms 0 m wake ilt pe pt write: reset:uu000000 u = undefined figure 7-7. sci control register 1 (sccr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers m68hc11k family technical data motorola serial communications interface (sci) 161 pe ? parity enable bit 0 = parity disabled 1 = parity enabled pt ? parity type bit 0 = parity even (even number of 1s causes parity bit to be 0, odd number of 1s causes parity bit to be 1) 1 = parity odd (odd number of 1s causes parity bit to be 0, even number of 1s causes parity bit to be 1) 7.9.3 serial communications control register 2 tie ? transmit interrupt enable bit 0 = tdre interrupts disabled 1 = sci interrupt is requested when the tdre status flag is set. tcie ? transmit complete interrupt enable bit 0 = tc interrupts disabled 1 = sci interrupt is requested when the tc status flag is set. rie ? receiver interrupt enable bit 0 = rdrf and or interrupts disabled 1 = sci interrupt is requested when the rdrf flag or or flag is set. ilie ? idle line interrupt enable bit 0 = idle interrupts disabled 1 = sci interrupt is requested when the idle status flag is set. address $0073 bit 7654321bit 0 read: tie tcie rie ilie te re rwu sbk write: reset:00000000 figure 7-8. sci control register 2 (sccr2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 162 serial communications interface (sci) motorola serial communications interface (sci) te ? transmitter enable bit when te goes from 0 to 1, one unit of idle character time (logic 1) is queued as a preamble. 0 = transmitter disabled 1 = transmitter enabled re ? receiver enable bit 0 = receiver disabled 1 = receiver enabled rwu ? receiver wakeup control 0 = normal sci receiver operation 1 = wakeup is enabled and receiver interrupts are inhibited. sbk ? send break bit at least one character time of break is queued and sent each time sbk is written to 1. multiple breaks may be sent if the transmitter is idle at the time the sbk bit is toggled on and off, as the baud rate clock edge could occur between writing the 1 and writing the 0 to sbk. 0 = break generator off 1 = break codes generated as long as sbk = 1 7.9.4 serial communication status register 1 the scsr provides flags for various sci conditions which can be polled or used to generate sci system interrupts. to clear any set flag, read scsr while the flag is set and then write to scdr. address $0074 bit 7654321bit 0 read: tdre tc rdrf idle or nf fe pf write: reset:11000000 figure 7-9. sci status register 1 (scsr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers m68hc11k family technical data motorola serial communications interface (sci) 163 tdre ? transmit data register empty flag tdre is set when the scdr transfers its contents to the transmission shift register. 0 = scdr is full. 1 = scdr is empty. tc ? transmit complete flag tc is set when the final character in a message has been sent (no data, preamble, or break transmissions pending). 0 = transmitter busy 1 = transmitter idle rdrf ? receive data register full flag rdrf is set when the shift register has received a complete character and transferred it to the receive data register. 0 = rdr not full 1 = rdr full idle ? idle line detected flag idle is set when a frame of all 1s is received after a message. 0 = rxd line is active. 1 = rxd line is idle. or ? overrun error flag or is set if a new character is received before a previously received character is read from scdr. 0 = no overrun 1 = overrun detected nf ? noise error flag nf is set after the last bit in a frame is received if the samples in the receiver ? s data recovery circuit are not unanimous for any of the bits, including start and stop bits. 0 = no noise detected 1 = noise detected f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 164 serial communications interface (sci) motorola serial communications interface (sci) fe ? framing error flag fe is set when a 0 is detected where a stop bit (logic 1) was expected. 0 = stop bit detected 1 = logic 0 detected at the end of a character pf ? parity error flag pf is set if received data has incorrect parity. clear pf by reading scsr1. 0 = parity disabled 1 = parity enabled 7.9.5 serial communication status register 2 raf ? receiver active flag raf is a read-only bit. 0 = receiver is inactive. 1 = a character is being received. address $0075 bit 7654321bit 0 read: 0 0 0 0 0 0 0 raf write: reset:11000000 = unimplemented figure 7-10. sci status register 2 (scsr2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial communications interface (sci) sci registers m68hc11k family technical data motorola serial communications interface (sci) 165 7.9.6 serial communications data register the scdr is a parallel register that performs two functions. received data in the rdr is read from this address when the sci is receiving, and data to be transmitted is written to this address when the sci is transmitting. r8 and t8 ? receiver bit 8 and transmitter bit 8 ninth data bit is received or transmitted when the system is configured for 8-bit data using mark address wakeup. r/t[7:0] ? receiver/transmitter bits [7:0] address $0076 bit 7654321bit 0 read: r8 t8 0 0 0 0 0 0 write: reset: undefined after reset address $0077 bit 7654321bit 0 read: r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 write: reset: undefined after reset figure 7-11. sci data register (scdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 166 serial communications interface (sci) motorola serial communications interface (sci) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola serial peripheral interface (spi) 167 technical data ? m68hc11k family section 8. serial peripheral interface (spi) 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167 8.3 spi functional description . . . . . . . . . . . . . . . . . . . . . . . . . . .168 8.4 spi signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.1 master in slave out (miso) . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.2 master out slave in (mosi) . . . . . . . . . . . . . . . . . . . . . . . .170 8.4.3 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 8.4.4 slave select (ss ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 8.4.5 spi timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 8.5 spi system errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 8.5.1 mode fault error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 8.5.2 write collision error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 8.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173 8.6.1 serial peripheral control register . . . . . . . . . . . . . . . . . . .174 8.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . . .176 8.6.3 serial peripheral data register . . . . . . . . . . . . . . . . . . . . .177 8.6.4 port d data direction register . . . . . . . . . . . . . . . . . . . . . .178 8.6.5 system configuration options 2. . . . . . . . . . . . . . . . . . . . .179 8.2 introduction the serial peripheral interface (spi) provides synchronous communication between the mcu and peripheral devices such as transistor-transistor logic (ttl) shift registers, liquid crystal display (lcd) drivers, analog-to-digital (a/d) converter subsystems, and other processors. synchronous communication requires a clock and, in the m68hc11 series, a slave-select signal, but provides substantially faster communication than the asynchronous sci, which does not require this f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 168 serial peripheral interface (spi) motorola serial peripheral interface (spi) extra hardware. the spi system can send data at up to one half of the e-clock rate when configured as master and the full e-clock rate when configured as a slave. 8.3 spi functional description the spi is a 4-wire, full-duplex communication system. characters are eight bits, transmitted most significant bit (msb) first. one master device exchanges data with one or more slave devices. each device selects its mode by writing either a 1 (master) or 0 (slave) to the mstr bit in the serial peripheral control register (spcr). as a master device transmits data to a slave device via the mosi (master out slave in) line, the slave transmits data to the master via the miso (master in slave out) line. the master produces a common synchronization clock signal and drives it on its sck (serial clock) pin, which is configured as an output. the slave sck pin is configured as an input to receive the clock. an external logic low signal is applied to the slave select pin (ss ) of each slave device for which a particular message is intended. devices not selected (ss high) ignore the transmission. received characters are double-buffered. serial input bits are fed into a shift register; when the last bit is received, the completed character is parallel-loaded to a read data buffer. this allows the next message to be received while the current message is being read. as long as the buffer is read before the next received character is ready to be transferred to the buffer, no overrun condition occurs. transmitted characters are not double-buffered, they are written directly to the output shift register. this means that new data for transmission cannot be written to the shift register until the previous transmission is complete. an attempt to write during data transmission will not go through; the transmission in progress will proceed undisturbed, and the mcu will set the write collision (wcol) status bit in the serial peripheral status register (spsr). after the last bit of a character is shifted out, the spi transfer complete flag (spif) of the spsr is set. this will also generate an interrupt if the spie (spi interrupt enable) bit in the spcr is set. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi functional description m68hc11k family technical data motorola serial peripheral interface (spi) 169 a single mcu register, the serial peripheral data register (spdr) is used both to read input data from the read buffer and to write output data to the transmit shift register. figure 8-1 shows the spi block diagram. figure 8-1. spi block diagram spr0 spr1 cpha cpol mstr dwom spe spie spi control register modf wcol spif spi status register 8/16-bit shift register read data buffer msb lsb internal data bus spi interrupt request mstr spe mstr dwom spe spr0 spi clock (master) spi control select divider internal mcu clock clock logic clock pin control logic s m s m m s miso pd2 mosi pd3 sck pd4 ss pd5 spr1 2 4 16 32 8 8 8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 170 serial peripheral interface (spi) motorola serial peripheral interface (spi) 8.4 spi signal descriptions the four basic spi signals (miso, mosi, sck, and ss ) are discussed for both the master and slave modes in the following paragraphs. every spi output line must have its corresponding port d data direction register (ddrd) bit set. if this bit is clear, the line is disconnected from the spi logic and becomes a general-purpose input line. spi input lines are not affected by the data direction register. 8.4.1 master in slave out (miso) the miso is one of two unidirectional serial data lines in the spi. it functions as an input in a master device and as an output in a slave device. the miso line of a slave device is placed in the high-impedance state if the slave is not selected. 8.4.2 master out slave in (mosi) this unidirectional serial data line is an output in a master device and an input in a slave device. 8.4.3 serial clock (sck) the serial clock (sck) synchronizes data movement both in and out of all devices. master and slave devices exchange a byte of information simultaneously during a sequence of eight clock cycles. sck is generated by the master device so its sck pin functions as an output. slave devices receive this signal through their sck pins, which are configured as inputs. the spi clock rate select bits in the master device determine the sck clock rate. these bits are spr[1:0] in the serial peripheral control register (spcr) and spr2 in the system configuration options 2 register (opt2). these bits have no effect in a slave device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi signal descriptions m68hc11k family technical data motorola serial peripheral interface (spi) 171 8.4.4 slave select (ss ) the slave select (ss ) input is used to target specific devices in the spi system. it must be pulled low on a targeted slave device prior to any communication with a master and must remain low for the duration of the transaction. ss must always be high on any device in master mode. pulling ss low on a master mode device generates a mode fault error (see 8.5.1 mode fault error ). 8.4.5 spi timing four possible timing relationships are available through control bits cpol (clock polarity) and cpha (clock phase) in the spcr. these bits must be the same in both master and slave devices. the master device always places data on the mosi line approximately a half-cycle before the sck clock edge. this enables the slave device to latch the data. see figure 8-2 . a write collision is normally a slave error because a slave has no control over when a master initiates a transfer. a master knows when a transfer is in progress, so there is no reason for a master to generate a write-collision error, although the spi logic can detect write collisions in both master and slave devices. figure 8-2. data clock timing diagram sck cycle # for reference 12345678 sck (cpol = 0) sck (cpol = 1) (cpha = 0) data out (cpha = 1) data out ss (to slave) sample input sample input msb654321lsb msb654321lsb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 172 serial peripheral interface (spi) motorola serial peripheral interface (spi) cpol selects an active high or low clock edge. cpha selects one of two transfer formats. when cpha is cleared, the shift clock is ored with ss . each slave ? s ss pin must be pulled high before it writes the next output byte to its data register. if a slave writes to its data register while ss is low, a write collision error occurs. when cpha is set, ss may be left low for several spi characters. when there is only one spi slave mcu, its ss line may be tied to v ss if cpha = 1 at all times. the spi configuration determines the characteristics of a transfer in progress. for a master, a transfer begins when data is written to spdr and ends when spif is set. for a slave with cpha cleared, a transfer starts when ss goes low and ends when ss returns high. in this case, spif is set at the middle of the eighth sck cycle when data is transferred from the shifter to the parallel data register, but the transfer is still in progress until ss goes high. for a slave with cpha set, transfer begins when the sck line goes to its active level, which is the edge at the beginning of the first sck cycle. the transfer ends when spif is set. sck in a slave must be inactive for at least two e-clock cycles between byte transfers. 8.5 spi system errors two types of errors can be detected by the spi system:  a mode fault error can occur when multiple devices attempt to act in master mode simultaneously.  a write collision error results from an attempt to write data to the spdr while a transmission is in progress. 8.5.1 mode fault error a mode fault error occurs when the ss input line of an spi system configured as a master goes to active low, usually because two devices have attempted to act as master at the same time. the resulting contention between push-pull cmos pin drivers can cause them permanent damage. the mode fault disables the drivers in an attempt to protect them. the mstr control bit in the spcr and all four ddrd f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers m68hc11k family technical data motorola serial peripheral interface (spi) 173 control bits associated with the spi are cleared, effectively forcing the pins to be high-impedance inputs. the mode fault error flag (modf) is set in the serial peripheral status register (spsr). an interrupt is generated, subject to masking by the spie control bit and the i bit in the ccr. to disable the mode fault circuit, write a 1 to ddrd bit 5. this configures port d bit 5 as a general-purpose output rather than ss . other precautions may be necessary to prevent driver damage. for instance, if two devices are made masters at the same time, mode fault does not help protect either one unless one of them selects the other as slave. the amount of damage possible depends on the length of time both devices attempt to act as master. 8.5.2 write collision error a write collision error occurs when the spdr is written while a transmission is in progress. the spdr is not double buffered in the transmit direction, so writes to the spdr go directly into the spi shift register, which would corrupt any transfer in progress. the mcu protects against this by preventing the write and generating the write collision error. the transmission continues undisturbed. a write collision is normally a slave error because a slave has no control over when a master initiates a transfer. a master knows when a transfer is in progress, so there is no reason for a master to generate a write-collision error, although the spi logic can detect write collisions in both master and slave devices. 8.6 spi registers the three spi registers provide control, status, and data storage functions respectively:  serial peripheral control register (spcr)  serial peripheral status register (spsr)  serial peripheral data register (spdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 174 serial peripheral interface (spi) motorola serial peripheral interface (spi) note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. 8.6.1 serial peripheral control register spie ? serial peripheral interrupt enable bit 0 = spi interrupt disabled 1 = spi interrupt is enabled each time the spif or modf status flag in spsr is set. spe ? serial peripheral system enable bit 0 = spi off 1 = spi on ? pd[5:2] function as spi signals dwom ? port d wired-or mode bit dwom affects only the four spi pins on port d, pd[5:2]. see also 7.9.2 serial communications control register 1 for a discussion of the woms (wired-or mode for sci pins) bit in the serial communications control register 1 (sccr1). 0 = normal cmos outputs 1 = open-drain outputs mstr ? master mode select bit 0 = slave mode 1 = master mode address: $0028 bit 7654321bit 0 read: spie spe dwom mstr cpol cpha spr1 spr2 write: reset:000001uu u = undefined figure 8-3. serial peripheral control register (spcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers m68hc11k family technical data motorola serial peripheral interface (spi) 175 cpol ? clock polarity bit when the clock polarity bit is cleared and data is not being transferred, the sck pin of the master device has a steady state low value. when cpol is set, sck idles high. cpha ? clock phase bit the clock phase bit, in conjunction with the cpol bit, controls the clock-data relationship between master and slave. the cpha bit selects one of two different clocking protocols. spr[1:0] ? spi clock rate select bits on a master device, these two bits in conjunction with spr2 in the opt2 register select the baud rate to be used as sck. see table 8-1 . these bits have no effect in slave mode. table 8-1. spi+ baud rates extal frequencies extal freq. 8.0 mhz 12.0 mhz 16.0 mhz 20.0 mhz 24.0 mhz other extal e clock freq. 2.0 mhz 3.0 mhz 4.0 mhz 5.0 mhz 6.0 mhz extal f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 176 serial peripheral interface (spi) motorola serial peripheral interface (spi) 8.6.2 serial peripheral status register spif ? spi transfer complete flag spif is set upon completion of data transfer between the processor and the external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. to clear the spif bit, read the spsr with spif set, then access the spdr. unless spsr is read (with spif set) first, attempts to write spdr are inhibited. wcol ? write collision bit clearing the wcol bit is accomplished by reading the spsr (with wcol set) followed by an access of spdr. 0 = no write collision 1 = write collision modf ? mode fault bit to clear the modf bit, read the spsr (with modf set), then write to the spcr. 0 = no mode fault 1 = mode fault address: $0029 bit 7654321bit 0 read: spif wcol 0modf 0 0 0 0 write: reset:00000000 figure 8-4. serial peripheral status register (spsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers m68hc11k family technical data motorola serial peripheral interface (spi) 177 8.6.3 serial peripheral data register the spdr is used when transmitting or receiving data on the serial bus. only a write to this register initiates transmission or reception of a byte, and this only occurs in the master device. at the completion of transferring a byte of data, the spif status bit is set in both the master and slave devices. a read of the spdr is actually a read of a buffer. to prevent an overrun and the loss of the byte that caused the overrun, the first spif must be cleared by the time a second transfer of data from the shift register to the read buffer is initiated. a write to spdr goes directly to the transmission shift register. a read of the spdr retrieves data from the read data buffer. address: $002a bit 7654321bit 0 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 8-5. serial peripheral data register (spdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 178 serial peripheral interface (spi) motorola serial peripheral interface (spi) 8.6.4 port d data direction register ddd5 bit bit 5 of the port d data register (pd5) is dedicated as the slave select (ss ) input. in spi slave mode, ddd5 has no meaning or effect. in spi master mode, ddd5 affects pd5 as follows: 0 = pd5 is an error-detect input to the spi. 1 = pd5 is configured as a general-purpose output line. ddd[4:2] bits when the spi is enabled, spi input pins remain functioning regardless of the state of the corresponding ddd[4:2] bits. for spi output pins, however, the corresponding ddd[4:2] bits must be set or the pins will function as general-purpose inputs. address: $0009 bit 7654321bit 0 read: 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 write: reset:00000000 figure 8-6. port d data direction register (ddrd) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial peripheral interface (spi) spi registers m68hc11k family technical data motorola serial peripheral interface (spi) 179 8.6.5 system configuration options 2 lsbf ? least significant bit first enable bit setting lsbf causes data to be transmitted lsb first (the default is msb first). lsbf does not affect bit positions in the data register; reads and writes always have msb in bit 7. spr2 ? spi clock rate select bit spr2 adds a divide-by-4 prescaler to the spi clock chain. with the two bits in the spcr, this specifies the spi clock rate. see table 8-1 . address: $0038 bit 7654321bit 0 read: lirdv cwom strch (1) irvne lsbf spr2 xdv1 xdv0 write: reset: 0 0 0 ? 0000 1. not available on m68hc11k devices figure 8-7. system configuration options 2 register (opt2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 180 serial peripheral interface (spi) motorola serial peripheral interface (spi) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola timing system 181 technical data ? m68hc11k family section 9. timing system 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182 9.3 timer structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183 9.4 input capture and output compare overview . . . . . . . . . . . .185 9.4.1 timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . . .188 9.4.2 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .189 9.4.3 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .189 9.4.4 port a data direction register . . . . . . . . . . . . . . . . . . . . . .190 9.4.5 pulse accumulator control register . . . . . . . . . . . . . . . . . 191 9.5 input capture (ic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191 9.5.1 timer input capture registers . . . . . . . . . . . . . . . . . . . . . .192 9.5.2 timer input capture 4/output compare 5 register . . . . . .193 9.5.3 timer interrupt flag 1 register . . . . . . . . . . . . . . . . . . . . .194 9.5.4 timer interrupt mask 1 register. . . . . . . . . . . . . . . . . . . . .194 9.5.5 timer control 2 register . . . . . . . . . . . . . . . . . . . . . . . . . .195 9.6 output compare (oc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196 9.6.1 timer output compare registers . . . . . . . . . . . . . . . . . . .197 9.6.2 timer input capture 4/output compare 5 register . . . . . .199 9.6.3 timer interrupt flag 1 register . . . . . . . . . . . . . . . . . . . . .199 9.6.4 timer interrupt mask 1 register. . . . . . . . . . . . . . . . . . . . .200 9.6.5 timer control 1 register . . . . . . . . . . . . . . . . . . . . . . . . . .200 9.6.6 timer compare force register . . . . . . . . . . . . . . . . . . . . .201 9.6.7 output compare 1 mask register . . . . . . . . . . . . . . . . . . .202 9.6.8 output compare 1 data register. . . . . . . . . . . . . . . . . . . .202 9.7 pulse accumulator (pa) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 9.7.1 port a data direction register . . . . . . . . . . . . . . . . . . . . . .205 9.7.2 pulse accumulator control register . . . . . . . . . . . . . . . . . 205 9.7.3 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .206 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 182 timing system motorola timing system 9.7.4 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .207 9.7.5 pulse accumulator count register . . . . . . . . . . . . . . . . . .208 9.8 real-time interrupt (rti) . . . . . . . . . . . . . . . . . . . . . . . . . . . .208 9.8.1 timer interrupt flag 2 register . . . . . . . . . . . . . . . . . . . . .209 9.8.2 timer interrupt mask 2 register. . . . . . . . . . . . . . . . . . . . .209 9.8.3 pulse accumulator control register . . . . . . . . . . . . . . . . . 210 9.9 pulse-width modulator (pwm) . . . . . . . . . . . . . . . . . . . . . . . .211 9.9.1 pwm system description. . . . . . . . . . . . . . . . . . . . . . . . . .211 9.9.2 pulse-width modulation control registers. . . . . . . . . . . . .213 9.9.2.1 pulse-width modulation timer clock select register . . . . . . . . . . . . . . . . . . . . . . . . 213 9.9.2.2 pulse-width modulation timer polarity register . . . . . .215 9.9.2.3 pulse-width modulation timer prescaler register . . . .215 9.9.2.4 pulse-width modulation timer enable register . . . . . .216 9.9.2.5 pulse-width modulation timer counters1 to 4 registers . . . . . . . . . . . . . . . . . . . . .217 9.9.2.6 pulse-width modulation timer periods 1 to 4 registers . . . . . . . . . . . . . . . . . . . . . .218 9.9.2.7 pulse-width modulation timer duty cycle 1 to 4 registers . . . . . . . . . . . . . . . . . . .219 9.2 introduction m68hc11 microcontrollers contain an extensive timing system to support a wide variety of timer-related functions. this section discusses the nature of the timing system and presents details of timer-related functions including:  input capture/output compare (ic/oc)  real-time interrupt (rti)  pulse accumulator (pa)  pulse width modulation (pwm) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system timer structure m68hc11k family technical data motorola timing system 183 9.3 timer structure as figure 9-1 shows, the primary system clocks, including the e clock and the internal ph2 bus clock, are derived from the oscillator output divided by four. figure 9-1. timer clock divider chains ( 1, 2, 3, 4, 5......8191) sbr[12:0] sci receiver clock sci transmit clock xout e clock ph 2 (internal bus prescaler ( 2, 4, 8, 16, 32, 64, 128) spr[2:0] 2 16 4 spi 1, 4, 6, 8 xdv[1:0]. tcnt ic/oc prescaler ( 1, 4, 8, 16) pr[1:0] postscaler pulse accumulator e 2 6 real-time interrupt e 2 13 4 prescaler ( 1, 2, 4, 8) rtr[1:0] prescaler ( 1, 4, 16, 64) cr[1:0] sq rq sq rq force cop reset system reset clear cop timer tof postscaler oscillator e 2 15 clock) 4 extal f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 184 timing system motorola timing system the ph2 bus clock feeds four primary divider chains. the functions supplied by each of these chains are: 1. serial peripheral interface (spi) 2. input capture/output compare (ic/oc) 3. pulse accumulator (pa) 4. rti and cop watchdog circuit the spi prescale factor is determined by bits spr[2] in the system configuration options 2 (opt2) register and spr[1:0] in the serial peripheral control register (spcr). see 8.6.1 serial peripheral control register and 8.6.5 system configuration options 2 . the input capture and output compare functions are based on a 16-bit free-running counter, which is driven by the ph2 clock divided by a programmable prescaler. bits pr[1:0] of the timer interrupt mask 2 (tmsk2) register enable the user to select one of four divisors: 1, 4, 8, or 16. the output of this prescaler, referred to as the main timer, feeds the divider chains for the pulse accumulator, rti, and cop circuits as well as the free-running counter. table 9-1 shows main timer frequencies and periods available from the most common crystal inputs. table 9-1. main timer rates extal frequencies extal freq. 8.0 mhz 12.0 mhz 16.0 mhz 20.0 mhz 20.0 mhz other extal e clock freq. 2.0 mhz 3.0 mhz 4.0 mhz 5.0 mhz 5.0 mhz extal/4 e clock period 500 ns 333 ns 250 ns 200 ns 200 ns 1/e control bits pr[1:0] main timer period (1 count/timer overflow) 1 count timer overflow 0 0 500 ns 32.768 ms 333 ns 21.845 ms 250 ns 16.384 ms 200 ns 13.107 ms 167 ns 10.923 ms 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture and output compare overview m68hc11k family technical data motorola timing system 185 the free-running counter begins incrementing from $0000 as the mcu comes out of reset and continues to the maximum count, $ffff. at the maximum count, the counter rolls over to $0000, sets the timer overflow flag (tof) in the timer interrupt flag 2 (tflg2) register, and continues to increment. the value in this counter can be read in the timer counter (tcnt) register, but cannot be written or changed except by reset. the pulse accumulator, described in 9.7 pulse accumulator (pa) , derives its clock by post-scaling the main timer so that the output frequency is always e clock divided by 64. this clock drives an 8-bit counter while the pulse accumulator is operating in event counting mode. rti is a programmable periodic interrupt circuit that can be used to pace the execution of software routines, as described in 9.8 real-time interrupt (rti) . the clock driving this function is also derived from the clock driving the free-running counter. the post-scaler output of this chain runs at a frequency of e clock divided by 2 13 . the cop watchdog timer ( 5.3.3 computer operating properly (cop) system ) further divides the rti clock by four to drive its circuitry at a frequency of e clock divided by 2 15 . 9.4 input capture and output compare overview the m68hc11k series features:  three input capture channels  four output compare channels  one channel that can be selected to perform either input capture or output compare each of the three input capture functions has its own 16-bit input capture register (time capture latch) and each of the output compare functions has its own 16-bit compare register. all timer functions, including the timer overflow and rti, have their own interrupt controls and separate interrupt vectors. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 186 timing system motorola timing system figure 9-2 shows the capture/compare system block diagram. the port a pin control block includes logic for timer functions and for general-purpose i/o. this block contains the edge-detection logic for pins pa[2:0] as well as the control logic that enables edge selection for the input capture trigger.  pa[2:0] can serve either as input capture pins ic[1:3] or as general-purpose input/output (gpio).  pa[6:4] can serve either as drivers for output compare functions oc[2:4] or gpio.  pa3 can be used for gpio, input capture 4, output compare 5, or output compare 1.  output compare 1 (oc1) has extra control logic which gives it optional control of any combination of the pa[7:3] pins.  the pa7 pin can be used as a gpio pin, as an input to the pulse accumulator, or as an oc1 output pin. reading the port a register returns the actual pin level on any pin functioning as an input, and the logic level of the internal pin driver (not the pin level) on any pin functioning as an output. this is true whether the pins are configured for timer functions or gpio. writing to port a pins configured for timer functions has no visible effect; the writes are latched but do not drive the pins. registers common to both the input capture and output compare functions include:  timer counter register (tcnt)  timer interrupt flag 2 (tflg2)  timer interrupt mask 2 (tmsk2)  data direction register a (ddra)  pulse accumulator control register (pactl) note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture and output compare overview m68hc11k family technical data motorola timing system 187 figure 9-2. capture/compare block diagram system 16-bit latch clk 4 5 6 7 8 port a pin control oc1i oc2i oc3i oc4i i4/o5i tflg 1 status flags foc1 foc2 foc3 foc4 foc5 oc1f oc2f oc3f oc4f i4/o5f pa3 pa4 pa5 pa6 pa7 i4/o5 16-bit comparator = toc1 (hi) toc1 (lo) 16-bit comparator = toc2 (hi) toc2 (lo) 16-bit comparator = toc3 (hi) toc3 (lo) 16-bit comparator = toc4 (hi) toc4 (lo) 16-bit comparator = ti4/o5 (hi) ti4/o5 (lo) 16-bit free counter tcnt (hi) tcnt (lo) 9 toi tof interrupt requests prescaler ? divide by 1, 4, 8, 16 pr1 16-bit timer bus oc5 ic4 tmsk 1 interrupt enables cforc force output pin functions pa0 3 2 1 ic1i ic2i ic3i ic1f ic2f ic3f pa1 pa2 16-bit latch tic1 (hi) tic1 (lo) clk 16-bit latch tic2 (hi) tic2 (lo) clk 16-bit latch tic3 (hi) tic3 (lo) clk ic3 ic2 ic1 pr0 clock oc1 oc2/oc1 oc3/oc1 oc4/oc1 ic4/oc5 oc1 compare running bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 188 timing system motorola timing system 9.4.1 timer counter register tcnt reflects the current value in the free-running counter. input capture functions use this number to mark the time of an external event, and output compare functions use it to determine the time at which to generate an event. in normal modes, tcnt is a read-only register. writes to tcnt in normal modes have no effect. tcnt can be read and written in special modes. bit 7654321bit 0 address: $000e ? tcnt (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:00000000 address: $000f ? tcnt (low) read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset:00000000 = unimplemented figure 9-3. timer counter register (tcnt) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture and output compare overview m68hc11k family technical data motorola timing system 189 9.4.2 timer interrupt flag 2 register clear each flag by writing a 1 to the corresponding bit position. tof ? timer overflow flag set when tcnt changes from $ffff to $0000. 9.4.3 timer interrupt mask 2 register bits in tmsk2 correspond bit for bit with flag bits in tflg2. toi ? timer overflow interrupt enable bit 0 = timer overflow interrupt disabled 1 = an interrupt request is generated when tof is set. address: $0025 bit 7654321bit 0 read: tof rtif paovf paif 0 0 0 0 write: reset:00000000 figure 9-4. timer interrupt flag 2 (tflg2) address: $0024 bit 7654321bit 0 read: toi rtii paovi paii 0 0pr1pr0 write: reset:00000000 figure 9-5. timer interrupt mask 2 (tmsk2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 190 timing system motorola timing system pr[1:0] ? timer prescaler select bits these bits determine the main timer prescale divisor, as shown in table 9-2 . the system bus (e clock) frequency is divided by this number to produce the clock which drives the free-running counter. refer to table 9-1 for specific timing values. in normal modes, pr[1:0] can be written only once, and the write must be within 64 cycles after reset. 9.4.4 port a data direction register dda3 ? data direction control for port a, bit 3 0 = pa3 configured as an input 1 = pa3 configured as an output table 9-2. timer prescale pr[1:0] prescaler 0 0 1 0 1 4 1 0 8 1 1 16 address: $0001 bit 7654321bit 0 read: dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 write: reset:00000000 figure 9-6. port a data direction register (ddra) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture (ic) m68hc11k family technical data motorola timing system 191 9.4.5 pulse accumulator control register i4/o5 ? input capture 4/output compare 5 bit 0 = configure pa3 as oc5 1 = configure pa3 as ic4 to configure pa3 as input compare 4, clear dda3 and set i4/05. to configure pa3 as output compare 5, set dda3 and clear i4/05. if the dda3 bit is set (configuring pa3 as an output) and ic4 is enabled, writing a one to ti4/o5 causes an input capture. writing to ti4/o5 has no effect when dda3 is cleared and/or oc5 is enabled. 9.5 input capture (ic) the input capture function records the time an external event occurs by latching the value of the free-running counter into one of the timer input capture (tic) registers when a selected edge is detected at its associated timer input pin. software can store latched values and use them to compute the period and duration of events. for example, by storing the times of successive edges of an incoming signal, software can determine the period and pulse width of a signal. to measure the period, two successive edges of the same polarity are captured. to measure pulse width, two alternate polarity edges are captured. capture requests are latched on the opposite half cycle of ph2 from when the timer counter is being incremented. this synchronization process introduces a delay between edge occurrence and counter value detection. because these delays offset each other when the time between two edges is measured, they can be ignored. there is a similar delay for output compare between the actual compare point and when the output pin changes state. address: $0026 bit 7654321bit 0 read: 0 paen pamod pedge 0i4/o5 rtr1 rtr0 write: reset:00000000 figure 9-7. pulse accumulator control register (pactl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 192 timing system motorola timing system 9.5.1 timer input capture registers bit 7654321bit 0 address: $0010 ? tic1 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset address: $0011 ? tic1 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: unaffected by reset address: $0012 ? tic2 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset address: $0013 ? tic2 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: unaffected by reset address: $0014 ? tic3 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset address: $0015 ? tic3 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: unaffected by reset figure 9-8. timer input capture registers (tic1 ? tic3) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture (ic) m68hc11k family technical data motorola timing system 193 9.5.2 timer input capture 4/output compare 5 register ti4/05 functions as the input capture register for ic4 when pa3 is configured for input capture 4. when an edge on an input capture pin has been detected and synchronized, the 16-bit free-running counter value is latched in the associated input capture register pair in a single 16-bit parallel transfer. the latch occurs on the opposite half-cycle of the phase two clock from when the timer counter is incremented. this ensures a stable count value whenever a capture occurs. input capture values can be retrieved from a tic register with two successive 8-bit reads. reading the high-order byte inhibits a new capture transfer for one bus cycle to ensure that the successive low-order byte read corresponds with it. if a new input capture occurs immediately after a high-order byte read, transfer is delayed for an additional cycle, but the new value is not lost. to assure coherency between the two bytes, use a double-byte read instruction such as ldd. bit 7654321bit 0 address: $001e ? ti4/o5 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $001f ? ti4/o5 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 figure 9-9. timer input capture 4/output compare 5 register (ti4/o5) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 194 timing system motorola timing system 9.5.3 timer interrupt flag 1 register clear each flag by writing a 1 to the corresponding bit position. icxf ? input capture x flag set each time a selected active edge is detected on the corresponding input capture line. i4/o5f ? input capture 4/output compare 5 flag set each time a selected active edge is detected on the ic4 line if ic4 is enabled. 9.5.4 timer interrupt mask 1 register bits in tmsk1 correspond bit for bit with flag bits in tflg1. icxi ? input capture interrupt enable bit if the icxi enable bit is set when the icxf flag bit is set, a hardware interrupt sequence is requested. address: $0023 bit 7654321bit 0 read: oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f write: reset:00000000 figure 9-10. timer interrupt flag 1 register (tflg1) address: $0022 bit 7654321bit 0 read: oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i write: reset:00000000 figure 9-11. timer interrupt mask 1 register (tmsk1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system input capture (ic) m68hc11k family technical data motorola timing system 195 i4/o5i ? input capture 4 or output compare 5 interrupt enable bit if i4/o5i is set when ic4 is enabled and the i4/o5f flag bit is set, a hardware interrupt sequence is requested. 9.5.5 timer control 2 register edgx[b:a] ? input capture edge control bits these bit pairs determine the edge polarities on the input capture pins that trigger the corresponding input capture functions. each of the input capture functions can be independently configured to detect rising edges only, falling edges only, any edge (rising or falling), or to disable the input capture function. the input capture functions operate independently of each other and can capture the same tcnt value if the input edges are detected within the same timer count cycle. each edgx bit pair is cleared (ic function disabled) by reset and must be encoded according to the values in table 9-3 to configure the corresponding input capture edge detector circuit. ic4 functions only if the i4/o5 bit in the pactl register is set. address: $0021 bit 7654321bit 0 read: edg4b edg4a edg1b edg1a edg2b edg2a edg3b edg3a write: reset:00000000 figure 9-12. timer control 2 register (tctl2) table 9-3. input capture edge selection edgxb edgxa icx configuration 0 0 capture disabled 0 1 capture on rising edges only 1 0 capture on falling edges only 1 1 capture on any edge f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 196 timing system motorola timing system 9.6 output compare (oc) the output compare (oc) function generates a programmed action when the 16-bit counter reaches a specified value. each of the five output compare functions contains a separate 16-bit timer output compare (toc) register and a dedicated 16-bit comparator. each toc register is set to $ffff on reset. when an oc channel is enabled, the value in its toc register is compared to the free-running counter value during each e-clock cycle. when the values match, the channel ? s output compare flag is set in timer interrupt flag 1 (tflg1). if the channel ? s interrupt is enabled in the timer interrupt mask register 1 (tmsk1), an interrupt is generated. also, the corresponding timer output pin is toggled or driven to a specified logic level. this pin activity occurs on each successful compare, whether or not the ocxf flag in the tflg1 register was previously cleared. the pin action for each of the oc channels [5:2] is controlled by a pair of bits (omx and olx) in the tctl1 register and affects only the channel ? s associated pin. a successful oc1 compare can affect any or all five of the oc pins. the action taken when a match is found for oc1 is controlled by two 8-bit registers:  output compare 1 mask register (oc1m)  output compare 1 data register (oc1d) oc1m specifies which port a outputs are to be used, and oc1d specifies the data placed on these port pins. although the m68hc11k series devices have four built-in pulse-width modulation (pwm) channels ( 9.9 pulse-width modulator (pwm) ), the output compare function can be used to produce an additional pulse-width modulated waveform. to produce a pulse of a specific duration:  write a value to the output compare register that represents the time the leading edge of the pulse is to occur.  use oc1d to select either a high or low output, depending on the polarity of the pulse being produced. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare (oc) m68hc11k family technical data motorola timing system 197  after a match occurs, change the appropriate oc1d bit to the opposite polarity, then add a value representing the width of the pulse to the original value and write it to the output compare register. because the pin state changes occur at specific values of the free-running counter, the pulse width can be controlled accurately to the resolution of the free-running counter, independent of software latencies. to generate an output signal of a specific frequency and duty cycle, repeat this pulse-generating procedure. 9.6.1 timer output compare registers bit 7654321bit 0 address: $0016 ? toc1 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $0017 ? toc1 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 address: $0018 ? toc2 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $0019 ? toc2 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 figure 9-13. timer output compare registers (toc1 ? toc4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 198 timing system motorola timing system all output compare registers are 16-bit read-write. any of these registers can be used as a storage location if it is not used for output compare or input capture. address: $001a ? toc3 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $001b ? toc3 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 address: $001c ? toc4 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $001d ? toc4 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 bit 7654321bit 0 figure 9-13. timer output compare registers (toc1 ? toc4) (continued) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare (oc) m68hc11k family technical data motorola timing system 199 9.6.2 timer input capture 4/output compare 5 register functions as the output compare register for oc5 when pa3 is configured for output compare 5. this register is 16-bit read-write. it can be used as a storage location if it is not used for output compare or input capture. 9.6.3 timer interrupt flag 1 register clear each flag by writing a 1 to the corresponding bit position. ocxf ? output compare x flag set each time the counter matches output compare x value. i4/o5f ? input capture 4/output compare 5 flag set each time the counter matches output compare 5 value if oc5 is enabled. bit 7654321bit 0 address: $001e ? ti4/o5 (high) read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $001f ? ti4/o5 (low) read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111111 figure 9-14. timer input capture 4/output compare 5 register (ti4/o5) address: $0023 bit 7654321bit 0 read: oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f write: reset:00000000 figure 9-15. timer interrupt flag 1 register (tflg1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 200 timing system motorola timing system 9.6.4 timer interrupt mask 1 register bits in tmsk1 correspond bit for bit with flag bits in tflg1. oc1i ? oc4i ? output compare x interrupt enable bits if the ocxi enable bit is set when the ocxf flag bit is set, a hardware interrupt sequence is requested. i4/o5i ? input capture 4 or output compare 5 interrupt enable bit if i4/o5i is set when oc5 is enabled and the i4/o5f flag bit is set, a hardware interrupt sequence is requested. 9.6.5 timer control 1 register om[2:5] and ol[2:5] ? output mode and output level bits use these bit pairs as indicated in table 9-4 to specify the action taken after a successful ocx compare. address: $0022 bit 7654321bit 0 read: oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i write: reset:00000000 figure 9-16. timer interrupt mask 1 register (tmsk1) address: $0020 bit 7654321bit 0 read: om2 ol2 om3 ol3 om4 ol4 om5 ol5 write: reset:00000000 figure 9-17. timer control register 1 (tctl1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system output compare (oc) m68hc11k family technical data motorola timing system 201 9.6.6 timer compare force register the cforc register allows forced early compares. writing a 1 to any bit of foc[1:5] forces the programmed pin actions for the corresponding oc channel to occur at the next timer count transition after the write to cforc. the action taken as a result of a forced compare is identical to the action taken when a match between the ocx register and the free-running counter occurs, except that the corresponding interrupt and status flag bits are not set. cforc should not be applied to an output compare function that is programmed to toggle its output on a successful compare because a normal compare that occurs immediately before or after the force can result in an undesirable operation. foc[1:5] ? force output comparison bits 0 = no action taken 1 = output x action occurs at the next timer count transition table 9-4. timer output compare actions omx olx action taken on successful compare 0 0 timer disconnected from output pin logic 0 1 toggle ocx output line 1 0 clear ocx output line to 0 1 1 set ocx output line to 1 address: $000b bit 7654321bit 0 read: foc1 foc2 foc3 foc4 foc5 0 0 0 write: reset:00000000 figure 9-18. timer compare force register (cforc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 202 timing system motorola timing system 9.6.7 output compare 1 mask register oc1m specifies which bits of port a will respond to a successful compare for output capture 1. the bits of the oc1m[7:3] register correspond to pa[7:3]. oc1m[7:3] ? output compare 1 masks 0 = oc1 is disabled at the corresponding pa pin. 1 = oc1 is enabled at the corresponding pa pin. 9.6.8 output compare 1 data register use this register in conjunction with oc1m to specify the data that is to drive the affected pin of port a after a successful oc1 compare. when a successful oc1 compare occurs, a data bit in oc1d is stored in the corresponding bit of port a for each bit that is set in oc1m. address: $000c bit 7654321bit 0 read: oc1m7 oc1m6 oc1m5 oc1m4 oc1m3 0 0 0 write: reset:00000000 figure 9-19. output compare 1 mask register (oc1m) address: $000d bit 7654321bit 0 read: oc1d7 oc1d6 oc1d5 oc1d4 oc1d3 0 0 0 write: reset:00000000 figure 9-20. output compare 1 data register (oc1d) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse accumulator (pa) m68hc11k family technical data motorola timing system 203 oc1d[7:3] ? output compare data bits 0 = corresponding port a pin is cleared on successful oc1 compare if the corresponding oc1m bit is set. 1 = corresponding port a pin is set on successful oc1 compare if the corresponding oc1m bit is set. 9.7 pulse accumulator (pa) the pulse accumulator can be used either to count events or measure the duration of a particular event. in event counting mode, the pulse accumulator ? s 8-bit counter increments each time a specified edge is detected on the pulse accumulator input pin, pa7. the maximum clocking rate for this mode is e clock divided by two. in gated time accumulation mode, an internal clock increments the 8-bit counter at a rate of e clock divided by 64 while the input at pa7 remains at a predetermined logic level. table 9-5 shows pulse accumulator clock periods for three common crystal frequencies. figure 9-21 is a block diagram of the pulse accumulator. table 9-5. pulse accumulator timing extal frequencies extal freq. 8.0 mhz 12.0 mhz 16.0 mhz 20.0 mhz 24.0 mhz other extal e clock freq. 2.0 mhz 3.0 mhz 4.0 mhz 5.0 mhz 6.0 mhz extal f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 204 timing system motorola timing system figure 9-21. pulse accumulator registers involved in pulse accumulator operation include:  data direction register a (ddra)  pulse accumulator control register (pactl)  timer interrupt mask 2 register (tmsk2)  timer interrupt flag 2 (tflg2)  pulse accumulator count register (pacnt) pacnt 8-bit counter 2:1 mux pa7/ enable overflow 1 interrupt requests internal data bus input buffer and edge detection pactl tflg2 tmsk2 paovi paii paen pamod pedge paovf paif output buffer pai edge paen e 64 clock from main timer pai/oc1 from main timer oc1 paen 2 clock from status flags interrupt enables control dda7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse accumulator (pa) m68hc11k family technical data motorola timing system 205 9.7.1 port a data direction register the pulse accumulator uses port a, bit 7 as the pai input, but the pin can also be used as general-purpose i/o or as an output compare. note: even when port a, bit 7 is configured as an output, the pin still drives the input to the pulse accumulator. dda7 ? data direction control for port a, bit 7 0 = pa7 configured as an input 1 = pa7 configured as an output 9.7.2 pulse accumulator control register pa en ? pulse accumulator system enable bit 0 = pulse accumulator disabled 1 = pulse accumulator enabled address: $0001 bit 7654321bit 0 read: dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 write: reset:00000000 figure 9-22. port a data direction register (ddra) address: $0026 bit 7654321bit 0 read: 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 write: reset:00000000 figure 9-23. pulse accumulator control register (pactl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 206 timing system motorola timing system pa mod ? pulse accumulator mode bit 0 = event counter 1 = gated time accumulation pedge ? pulse accumulator edge control bit in event counting mode, pedge selects either the rising or falling edge of the input at pa7 to increment the pulse accumulator counter. in gated accumulation mode, pedge determines which input level at pa7 inhibits counter increments from the internal clock. table 9-6 shows the relationship between pedge and pamod. 9.7.3 timer interrupt flag 2 register clear each flag by writing a 1 to the corresponding bit position. table 9-6. pulse accumulator edge control pamod pedge action on clock 0 0 pai falling edge increments the counter. 0 1 pai rising edge increments the counter. 1 0 a 0 on pai inhibits counting. 1 1 a 1 on pai inhibits counting. address: $0025 bit 7654321bit 0 read: tof rtif paovf paif 0 0 0 0 write: reset:00000000 figure 9-24. timer interrupt flag 2 (tflg2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse accumulator (pa) m68hc11k family technical data motorola timing system 207 9.7.4 timer interrupt mask 2 register bits in tmsk2 correspond bit for bit with flag bits in tflg2. pa ovf ? pulse accumulator overflow flag the paovf status bit is set each time the pulse accumulator count rolls over from $ff to $00. paovi ? interrupt enable bit if paovi is set, an interrupt request is also generated. if paovi is cleared, pulse accumulator overflow interrupts are inhibited, and paovf must be polled by user software to determine when an overflow has occurred. in either case, software must clear paovf by writing a 1 to bit 5 in the tflg2 register. pa if ? pulse accumulator input edge flag the paif status bit is automatically set each time a selected edge is detected at the pa7 pin. paii ? interrupt enable bit if paii is set, an interrupt request is also generated. if paii is cleared, pulse accumulator input interrupts are inhibited, and paif must be polled by user software to determine when an input edge has been detected. in either case, software must clear paif by writing a 1 to bit 5 in the tflg2 register. address: $0024 bit 7654321bit 0 read: toi rtii paovi paii 0 0 pr1 pr0 write: reset:00000000 figure 9-25. timer interrupt mask 2 (tmsk2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 208 timing system motorola timing system 9.7.5 pulse accumulator count register in event counting mode, pacnt contains the count of external input events at the pai input. in gated accumulation mode, pacnt is incremented by the pulse accumulator ? s e address: $0027 bit 7654321bit 0 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 9-26. pulse accumulator count register (pacnt) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system real-time interrupt (rti) m68hc11k family technical data motorola timing system 209 associated with flag clearing and service. for this reason, an rti period starts from the previous timeout, not from when rtif is cleared. 9.8.1 timer interrupt flag 2 register clear each flag by writing a 1 to the corresponding bit position. rtif ? real-time interrupt flag the rtif status bit is automatically set to 1 at the end of every rti period. 9.8.2 timer interrupt mask 2 register bits in tmsk2 correspond bit for bit with flag bits in tflg2. rtii ? real-time interrupt enable bit 0 = rtif interrupts disabled 1 = interrupt requested when rtif is set to 1 address: $0025 bit 7654321bit 0 read: tof rtif paovf paif 0 0 0 0 write: reset:00000000 figure 9-27. timer interrupt flag 2 register (tflg2) address: $0024 bit 7654321bit 0 read: toi rtii paovi paii 0 0 pr1 pr0 write: reset:00000000 figure 9-28. timer interrupt mask 2 register (tmsk2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 210 timing system motorola timing system 9.8.3 pulse accumulator control register rtr[1:0] ? real-time interrupt rate select bits these two bits select a divisor (1, 2, 4, or 8) for the e 2 13 rti clock. refer to table 9-7 . address: $0026 bit 7654321bit 0 read: 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 write: reset:00000000 figure 9-29. pulse accumulator control register (pactl) table 9-7. real-time interrupt rate versus rtr[1:0] rtr[1:0] rate xtal = 12.0 mhz xtal = 2 23 xtal = 8.0 mhz xtal = 4.9152 mhz xtal = 4.0 mhz xtal = 3.6864 mhz 00 2 13 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulator (pwm) m68hc11k family technical data motorola timing system 211 9.9 pulse-width modulator (pwm) four 8-bit pulse-width modulation channels are available in the m68hc11k family devices. they are output on port h pins 3 ? 0. pairs of channels can be concatenated to produce 16-bit outputs. three programmable clocks and a flexible clock selection scheme provide a wide range of frequencies. the 8-bit mode with e = 4 mhz can produce waveforms from 40 khz at 1 percent duty cycle resolution to less than 10 hz at 0.4 percent duty cycle resolution. in 16-bit mode, a duty cycle resolution down to 15 parts per million can be achieved (at a frequency of 60 hz). at 1 khz, the duty cycle resolution is 250 ppm. 9.9.1 pwm system description figure 9-30 shows a block diagram of the pwm system. each of four channels is enabled by bit pwenx in the pwen register. each channel has an 8-bit counter (pwcntx), a period register (pwperx), and a duty cycle register (pwdtyx). the counter is driven by one of three user-scaled clock sources ? clock a, b, or s ? selected by the pulse-width channel select (pclkx) bit in the pulse-width modulation timer polarity (pwpol) register. a pulse-width modulation period begins when the counter matches the value stored in the period register. when this happens, a logic value determined by the polarity bit (ppolx) in the pwpol register is driven on the associated port h output pin, and the counter is reset to 0. when the counter matches the number stored in the duty cycle register, the output reverses polarity. the period and duty cycle registers are double buffered so they can be changed without disturbing the current waveform. a new period or duty cycle can be forced by writing to the period (pwperx) or duty cycle register (pwdtyx) and then to the counter (pwcntx). writing to the counter always resets it to 0. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 212 timing system motorola timing system figure 9-30. pulse-width modulation timer block diagram sq rq 1 2 4 8 16 32 64 128 select pckb1 pckb2 pckb3 select pcka1 pcka2 8-bit counter 8-bit compare pwscal = 8 2 reset clock s clock b clock select clock a pwen1 clock select pwen2 con12 pclk1 pclk2 e clock cnt4 cnt3 cnt2 cnt1 sq rq sq rq s r control 16-bit pwm control 16-bit pwm pw1 pw2 pw3 pw4 m u x m u x m u x port h pin control bit 0 bit 1 bit 2 bit 3 8-bit compare pwdty2 = 8-bit compare pwper2 = 8-bit compare pwdty4 = 8-bit compare pwper4 = 8-bit compare pwdty1 = 8-bit compare pwper1 = 8-bit compare pwdty3 = 8-bit compare pwper3 = reset pwcnt2 carry pwcnt1 reset pwcnt4 carry pwcnt3 8 8 8 8 con12 con34 ppol1 ppol3 ppol4 ppol2 pwper pwdty pclk3 pclk4 pwen3 pwen4 con12 reset reset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulator (pwm) m68hc11k family technical data motorola timing system 213 the three clocks are derived from the e clock by writing to registers which determine their scaling factors. the clock a frequency is equal to e divided by 1, 2, 4, or 8, depending on which bits (pcka[2:1]) in the pwclk register are set. the clock b frequency is equal to the e clock divided by a power of two determined by bits pckb[3:1] in the pwclk register. clock s is derived by dividing clock a by the integer (1 to 256) stored in the pwscal register, then by two. two channels can be concatenated by setting the appropriate bit (con34 or con12) in the pwclk register. in this mode, the clock source is determined by the low-order channel, which is channel two in con12 and channel four in con34. the output is also placed on the pin associated with the low-order channels, so when two channels are concatenated the pin associated with the high-order channel (ph0 and/or ph2) can be used for gpio. a read of the high-order byte causes the low-order byte to be latched for one cycle to guarantee that double-byte reads are accurate. a write to the low-order byte of the counter causes reset of the entire counter. a write to the high-order byte of the counter has no effect. 9.9.2 pulse-width modulation control registers the pwm control registers are described here. 9.9.2.1 pulse-width modulation timer clock select register address: $0060 bit 7654321bit 0 read: con34 con12 pcka2 pcka1 0 pckb3 pckb2 pckb1 write: reset:00000000 figure 9-31. pulse-width modulation timer clock select (pwclk) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 214 timing system motorola timing system con34 ? concatenate channels 3 and 4 bit channel 3 is the high-order byte, and channel 4 (port h, bit 3) is output. 0 = channels 3 and 4 are separate 8-bit pwms. 1 = channels 3 and 4 are concatenated to create one 16-bit pwm. con12 ? concatenate channels 1 and 2 bit channel 1 is the high-order byte, and channel 2 (port h, bit 1) is output. 0 = channels 1 and 2 are separate 8-bit pwms. 1 = channels 1 and 2 are concatenated to create one 16-bit pwm. pcka[2:1] ? prescaler for clock a bits these bits select the frequency for clock a as shown in table 9-8 . pckb[3:1] ? prescaler for clock b bits these bits select the frequency for clock b as shown in table 9-9 . table 9-8. clock a prescaler pcka[2:1] clock a frequency 00 e 01 e/2 10 e/4 11 e/8 table 9-9. clock b prescaler pckb[3:1] clock b frequency 000 e 001 e/2 010 e/4 011 e/8 100 e/16 101 e/32 110 e/64 111 e/128 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulator (pwm) m68hc11k family technical data motorola timing system 215 9.9.2.2 pulse-width modulation timer polarity register pclk[4:3] ? pulse-width channel 4, 3 clock select bits 0 = clock b is source. 1 = clock s is source. pclk[2:1] ? pulse-width channel 2, 1 clock select bits 0 = clock a is source. 1 = clock s is source. ppol[4:1] ? pulse-width channel x polarity bits 0 = pwm channel x output is low at the beginning of the clock cycle and goes high when duty count is reached. 1 = pwm channel x output is high at the beginning of the clock cycle and goes low when duty count is reached. 9.9.2.3 pulse-width modulation timer prescaler register scaled clock s is generated by dividing clock a by the value in pwscal, then dividing the result by two. if pwscal = $00, the divisor is 256, then two. address: $0061 bit 7654321bit 0 read: pclk4 pclk3 pclk2 pclk1 ppol4 ppol3 ppol2 ppol1 write: reset:00000000 figure 9-32. pulse-width modulation timer polarity register (pwpol) address: $0062 bit 7654321bit 0 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 9-33. pulse-width modulation timer prescaler register (pwscal) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 216 timing system motorola timing system 9.9.2.4 pulse-width modulation timer enable register tpwsl ? pwm scaled clock test bit ? factory use only; only accessible in special test mode 0 = normal operation 1 = clock s is output to pwscal register (test only) discp ? disable compare scaled e-clock bit ? factory use only; only accessible in special test mode 0 = normal operation 1 = match of period does not reset associated count register (test only) pwen[4:1] ? pulse-width enable for channels [4:1] bits 0 = channel disabled 1 = channel enabled at port h bits [3:0] address: $0063 bit 7654321bit 0 read: tpwsl discp 0 0 pwen4 pwen3 pwen2 pwen1 write: reset:00000000 figure 9-34. pulse-width modulation timer enable register (pwen) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulator (pwm) m68hc11k family technical data motorola timing system 217 9.9.2.5 pulse-width modulation timer counters 1 to 4 registers each counter resets to 0 when it is written and can be read at any time. bit 7654321bit 0 address: $0064 ? pwcnt1 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $0065 ? pwcnt2 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $0066 ? pwcnt3 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $0067 ? pwcnt4 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 9-35. pulse-width modulation timer counters 1 to 4 (pwcnt1 to pwcnt4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 218 timing system motorola timing system 9.9.2.6 pulse-width modulation timer periods 1 to 4 registers each period register can be read or written at any time. if it is written, the new period will not take effect until the associated counter is reset by a match or a write. bit 7654321bit 0 address: $0068 ? pwper1 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $0069 ? pwper2 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $006a ? pwper3 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $006b ? pwper4 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 9-36. pulse-width modulation timer periods 1 to 4 (pwper1 to pwper4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
timing system pulse-width modulator (pwm) m68hc11k family technical data motorola timing system 219 9.9.2.7 pulse-width modulation timer duty cycle 1 to 4 registers each duty cycle register can be read or written at any time. if it is written, the new duty cycle will not take effect until the associated counter is reset by a match or a write. bit 7654321bit 0 address: $006c ? pwdty1 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $006d ? pwdty2 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $006e ? pwdty3 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 address: $006f ? pwdty4 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:00000000 figure 9-37. pulse-width modulation timer duty cycle 1 to 4 (pwdty1 to pwdty4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 220 timing system motorola timing system f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola analog-to-digital (a/d) converter 221 technical data ? m68hc11k family section 10. analog-to-digital (a/d) converter 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 10.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222 10.3.1 multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.2 analog converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.3 result registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223 10.3.4 digital control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 10.4 a/d control/status registers . . . . . . . . . . . . . . . . . . . . . . . . . 226 10.4.1 system configuration options register . . . . . . . . . . . . . . .226 10.4.2 a/d control/status register . . . . . . . . . . . . . . . . . . . . . . . . 227 10.4.3 analog-to-digital converter result registers. . . . . . . . . . .229 10.5 design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 10.5.1 a/d input pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 10.5.2 operation in stop and wait modes . . . . . . . . . . . . . . . . . .230 10.2 introduction the analog-to-digital (a/d) system in m68hc11 microcontrollers is an 8-channel, 8-bit, multiplexed input converter. it employs a successive approximation technique with an all-capacitive charge redistribution system that does not require external sample-and-hold circuits. a/d converter timing can be synchronized either to the e clock or an internal resistor-capacitor (rc) oscillator. separate power supply inputs, av dd and av ss , allow independent bypassing for noise immunity. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 222 analog-to-digital (a/d) converter motorola analog-to-digital (a/d) converter 10.3 functional description the a/d converter system consists of four functional blocks as shown in figure 10-1 :  multiplexer  analog converter  result storage  digital control figure 10-1. a/d converter block diagram pe0 an0 v rh v rl pe1 an1 pe2 an2 pe3 an3 pe4 an4 pe5 an5 pe6 an6 pe7 an7 result register interface adctl scan mult cd cc cb ca ccf result adr1 adr2 adr3 adr4 8-bit capacitive dac with sample and hold successive approximation register and control analog mux internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter functional description m68hc11k family technical data motorola analog-to-digital (a/d) converter 223 10.3.1 multiplexer the multiplexer selects which of the eight analog inputs at port e will be converted. there are also three internal reference levels which can be multiplexed to the converter for system testing. input selection is controlled by the value of bits cd:ca in the a/d control register (adctl). the v rh and v rl pins provide inputs for the a/d system reference voltage. an input voltage equal to v rl converts to $00 and an input voltage equal to v rh converts to $ff (full scale), with no overflow indication. for ratiometric conversions of this type, the source of each analog input should use v rh as the supply voltage and be referenced to v rl . 10.3.2 analog converter the conversion block contains a digital-to-analog capacitor (dac) array, a comparator, and a successive approximation register (sar). when an analog input is sampled for conversion, an analog switch connects the input to the dac array. this series of scaled capacitors retains the sample for the duration of the conversion. a conversion consists of a sequence of eight comparison operations. each comparison determines one bit of the result, starting with the most significant bit (msb). during each comparison, analog switches connect different elements of the dac array to the comparator. the output of the comparator is stored in the next bit in the successive approximation register. when a conversion sequence is complete, the contents of the sar are transferred to the appropriate result register. 10.3.3 result registers the a/d conversion sequence begins one e-clock cycle after a write to the analog-to-digital control/status register (adctl). converter operations are performed in sequences of four conversions each. each conversion result in a sequence is stored in one of the four result registers, adr[4:1]. the conversion complete flag (ccf) in the adctl f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 224 analog-to-digital (a/d) converter motorola analog-to-digital (a/d) converter register is set after the fourth conversion in a sequence to signal the availability of data in the result registers.the result registers are written during a portion of the system clock cycle when reads do not occur, so there is no conflict. a conversion sequence can repeat continuously or stop after one iteration. figure 10-2 shows the timing of a typical sequence. in this example, synchronization is referenced to the system e clock. figure 10-2. a/d conversion sequence 10.3.4 digital control in addition to the conversion complete status flag, adctl bits select single or continuous conversions, whether conversions are performed on single or multiple channels, and the analog input(s) to be converted. single or continuous conversions are selected by the scan bit. clearing the scan bit selects the single conversion option, in which results are written to each of the four result registers one time. the first result is stored in a/d result register 1 (adr1), and the fourth result is stored in adr4. all conversion activity is then halted until the adctl register is written again. in the continuous mode (scan =1), conversion activity does not stop. the fifth conversion is stored in register adr1 (overwriting the first conversion result), the sixth conversion overwrites adr2, and so on. 0 32 64 96 128 ? e cycles sample analog input successive approximation sequence msb 4 cycles bit 6 2 cyc bit 5 2 cyc bit 4 2 cyc bit 3 2 cyc bit 2 2 cyc bit 1 2 cyc lsb 2 cyc 2 cyc end repeat sequence, scan = 1 set cc flag convert first channel, update adr1 convert second channel, update adr2 convert third channel, update adr3 convert fourth channel, update adr4 12 e cycles write to adctl e clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter functional description m68hc11k family technical data motorola analog-to-digital (a/d) converter 225 the mult bit in adctl determines whether one or four channels are converted. when mult = 0, one channel is converted. the selected channel is sampled and the conversion results are written to adr1; the same channel is sampled again, and the conversion results are stored in adr2, and so on. in continuous mode, the same channel continues to be sampled and converted. setting the mult bit converts four different channels; each result register contains the conversion result of a different channel. in continuous mode, the same four channels are converted in each sequence. adctl bits [3:0] select the particular channel(s) to be converted. see table 10-1 . table 10-1. a/d converter channel selection channel select control bits channel signal result location when mult = 1 cd:cc:cb:ca 0000 an0 adr1 0001 an1 adr2 0010 an2 adr3 0011 an3 adr4 0100 an4 adr1 0101 an5 adr2 0110 an6 adr3 0111 an7 adr4 10xx reserved ? 1100 v rh (1) 1. used for factory testing adr1 1101 v rl (1) adr2 1110 (v rh )/2 (1) adr3 1111 reserved (1) adr4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 226 analog-to-digital (a/d) converter motorola analog-to-digital (a/d) converter 10.4 a/d control/status registers the registers involved in a/d operation include option, adctl, and the four result registers adr[1:4]. note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. 10.4.1 system configuration options register bit 7 in the system configuration options register (option), adpu, enables the a/d converter system. setting adpu applies power to the a/d circuitry, including the charge pump that drives the analog switches. clearing adpu removes power from the a/d system. the gates of analog switches in the multiplexer are driven by a charge pump that develops between seven and eight volts. the high gate voltage assures low source-to-drain impedance for the analog signals. both the charge pump and the comparator circuits require up to 100 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter a/d control/status registers m68hc11k family technical data motorola analog-to-digital (a/d) converter 227 adpu ? a/d power-up 0 = a/d powered down 1 = a/d powered up csel ? clock select 0 = a/d and eeprom use system e clock. 1 = a/d and eeprom use internal rc clock. 10.4.2 a/d control/status register all bits in this register can be read or written except bit 7, which is a read-only status indicator, and bit 6, which always reads as 0. writing to adctl initiates a conversion, aborting any conversion in progress. address: $0039 bit 7654321bit 0 read: adpu csel irqe dly (1) cme fcme cr1 cr0 write: reset:00010000 1. dly can be written only once in the first 64 cycles out of reset in normal modes or at any time in special modes. figure 10-3. system configuration options register (option) address: $0030 bit 7654321bit 0 read: ccf scan mult cd cc cb ca write: reset:0 0uuuuuu = unimplemented u = unaffected by reset figure 10-4. analog-to-digital control/status register (adctl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 228 analog-to-digital (a/d) converter motorola analog-to-digital (a/d) converter ccf ? conversions complete flag set when all four a/d result registers contain valid conversion results. cleared when the adctl register is overwritten, starting a new conversion sequence. in continuous mode, ccf is set at the end of the first conversion sequence. scan ? continuous scan control bit 0 = conversion process stops after each of the four result registers is written. 1 = conversions are performed continuously. mult ? multiple channel/single channel control bit 0 = a single channel specified by the four channel select bits cd:ca is sampled and converted four times. 1 = each of four channels is converted and the results written to a different result register. note: when the multiple-channel continuous scan mode is used, extra care is needed in the design of circuitry driving the a/d inputs. the charge on the capacitive dac array before the sample time is related to the voltage on the previously converted channel. a charge share situation exists between the internal dac capacitance and the external circuit capacitance. although the amount of charge involved is small, the rate at which it is repeated is every 64 s for an e clock of 2 mhz. the rc charging rate of the external circuit must be balanced against this charge sharing effect to avoid errors in accuracy. refer to the m68hc11 reference manual, motorola document order number m68hc11rm/ad, for further information. cd:ca ? channel selects d:a bits refer to table 10-1 . in multiple channel mode (mult = 1), the two least significant channel select bits (cb and ca) have no meaning and the cd and cc bits specify which group of four channels is to be converted. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter a/d control/status registers m68hc11k family technical data motorola analog-to-digital (a/d) converter 229 10.4.3 analog-to-digital converter result registers these read-only registers hold an 8-bit conversion result. writes to these registers have no effect. data in the a/d converter result registers is valid when the ccf flag in the adctl register is set, indicating a conversion sequence is complete. if conversion results are needed sooner, refer to figure 10-2 , which shows the a/d conversion sequence diagram. bit 7654321bit 0 address: $0031 analog-to-digital result register 1 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset address: $0032 analog-to-digital result register 2 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset address: $0033 analog-to-digital result register 3 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset address: $0034 analog-to-digital result register 4 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: undefined after reset = unimplemented figure 10-5. analog-to-digital result registers (adr1 ? adr4)) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 230 analog-to-digital (a/d) converter motorola analog-to-digital (a/d) converter 10.5 design considerations this section discusses design considerations. 10.5.1 a/d input pins port e pins can also be used as general-purpose digital inputs. digital reads of port e pins are not recommended during the sample portion of an a/d conversion cycle, when the gate signal to the n-channel input is on. no p-channel devices are directly connected to either input pins or reference voltage pins, so voltages above v dd do not cause a latchup problem, although current should be limited according to maximum r a tings. r e fer to f i g u r e 1 0 -6 . figure 10-6. electrical model of an a/d input pin (sample mode) 10.5.2 operation in stop and wait modes if a conversion sequence is in progress when either the stop or wait mode is entered, the conversion of the current channel is suspended. when the mcu resumes normal operation, that channel is resampled and the conversion sequence is resumed. as the mcu exits the wait mode, the a/d circuits are stable and valid results can be obtained on the first conversion. however, in stop mode, all analog bias currents are disabled and it is necessary to allow a stabilization period when leaving stop mode. if stop mode is exited with a delay (dly = 1), there is enough time for these circuits to stabilize before the first conversion. if stop mode is exited with no delay (dly bit in option register = 0), allow 10 ms for the a/d circuitry to stabilize to avoid invalid results. diffusion/poly < 2 pf coupler 400 na junction leakage + ~20 v ? ~0.7 v * note 1. this analog switch is closed only during the 12-cycle sample time. v rl input + ~12 v ? ~0.7 v protection device 4 k ? dummy n-channel output device analog input pin ~ 20 pf dac capacitance see note 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola memory expansion and chip selects 231 technical data ? m68hc11k family section 11. memory expansion and chip selects 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 11.3 memory expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232 11.3.1 memory size and address line allocation. . . . . . . . . . . . .232 11.3.2 control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234 11.3.2.1 port g assignment register . . . . . . . . . . . . . . . . . . . . .234 11.3.2.2 memory mapping size register . . . . . . . . . . . . . . . . . . .235 11.3.2.3 memory mapping window base register . . . . . . . . . . .236 11.3.2.4 memory mapping window control registers. . . . . . . . .237 11.4 chip selects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 11.4.1 program chip select . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240 11.4.2 input/output chip select . . . . . . . . . . . . . . . . . . . . . . . . . . 241 11.4.3 general-purpose chip selects. . . . . . . . . . . . . . . . . . . . . .242 11.4.3.1 memory mapping size register . . . . . . . . . . . . . . . . . . .243 11.4.3.2 general-purpose chip select 1 address register. . . . .243 11.4.3.3 general-purpose chip select 1 control register . . . . .244 11.4.3.4 general-purpose chip select 2 address register. . . . .245 11.4.3.5 general-purpose chip select 2 control register . . . . .245 11.4.4 one chip select driving another . . . . . . . . . . . . . . . . . . . . 246 11.4.4.1 general-purpose chip select 1 control register . . . . .247 11.4.4.2 general-purpose chip select 2 control register . . . . .247 11.4.5 clock stretching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248 11.5 memory expansion examples . . . . . . . . . . . . . . . . . . . . . . . .249 11.2 introduction this section provides descriptions of the expanded memory and the chip selects. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 232 memory expansion and chip selects motorola memory expansion and chip selects 11.3 memory expansion the m68hc11k family devices employ a register-based paging scheme to extend their address range beyond the physical 64-kbyte limit of the 16 cpu address lines. pages are selected using the expansion address lines xa[18:13] available on port g. this selection can be facilitated by the chip-select lines on port h, discussed in 11.4 chip selects . the m68hc11ks devices do not provide these features since they lack the required port g and port h lines. refer to figure 1-2. m68hc11ks family block diagram . 11.3.1 memory size and address line allocation to access expanded memory, the user first allocates portion(s) of the 64 kbyte address space, or window(s), through which the cpu will view external memory. one or two windows can be designated, and the size of each window can be 0 (disabled), 8, 16, or 32 kbytes. expanded memory is addressed with a combination of the cpu ? s normal address lines addr[15:0] and the expansion address lines xa[18:13]. the expansion address lines select a memory bank, and the cpu ? s normal address lines select a particular location within the bank. the size of the window(s) and the number of memory banks determine exactly which expansion address lines are used. the port g assignment register (pgar) controls which port g pins function as expanded address lines. any port g pins not allocated for memory expansion can serve as general-purpose input/output (gpio). when a configuration uses any of the lower three expansion address lines xa[15:13] they replace the cpu's equivalent address lines (addr[15:13]). table 11-1 shows how address and expansion lines are allocated for various combinations of memory banks and window size. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects memory expansion m68hc11k family technical data motorola memory expansion and chip selects 233 the base address for each window must be an integer multiple of the window size, with one exception. when the window size is 32 kbytes, the base address can be at $4000 as well as the 32-kbyte multiples $0000 and $8000. this special case requires a modification in address line deployment. normally, when the bank size is 32 kbytes and the bank address is $0000 or $8000, cpu address lines addr[14:0] select individual bytes within the 32-kbyte space and the addr[14:0] pins are connected to address lines a[14:0] of the memory device. when the base address is $4000, the cpu address signal addr14 must be inverted to allow 32 kbytes of contiguous memory. to do this, the cpu drives the inverted addr14 signal onto the xa14 pin when the window is active, and the non-inverted cpu addr14 signal onto the xa14 pin when the window is not active. therefore, address 14 of the memory device must be connected to expansion line xa14 rather than normal address line addr14. if the two memory windows overlap, window 1 has priority, and only the portion of window 2 that does not overlap window 1 remains active. if a table 11-1. cpu address and address expansion signals number of banks window size 8 kbytes 16 kbytes 32 kbytes 32 kbytes (window based at $4000) 2 addr[12:0] xa13 addr[13:0] xa14 addr[14:0] xa15 addr[13:0] xa[15:14] 4 addr[12:0] xa[14:13] addr[13:0] xa[15:14] addr[14:0] xa[16:15] addr[13:0] xa[16:14] 8 addr[12:0] xa[15:13] addr[13:0] xa[16:14] addr[14:0] xa[17:15] addr[13:0] xa[17:14] 16 addr[12:0] xa[16:13] addr[13:0] xa[17:14] addr[14:0] xa[18:15] addr[13:0] xa[18:14] 32 addr[12:0] xa[17:13] addr[13:0] xa[18:14] ? ? ? ? 64 addr[12:0] xa[18:13] ? ? ? ? ? ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 234 memory expansion and chip selects motorola memory expansion and chip selects window overlaps any portion of internal registers, ram, or eeprom, that portion is repeated in all banks associated with that window. if a window overlaps (ep)rom, the (ep)rom is present in all banks with xa[18:16] = 0:0:0. the reset vector most commonly resides in on-chip (ep)rom at address $fffe ? $ffff. however, if the (ep)rom is disabled or mapped at address $2000 ? $7fff, the reset vector is fetched from external memory at $fffe ? $ffff. when expanded memory is enabled, the reset vector is fetched from external memory at $7ffe ? $7fff, regardless of the presence of on-chip (ep)rom. 11.3.2 control registers expansion address lines are enabled by the port g assignment register (pgar). the size and position of memory windows are controlled by the memory mapping size (mmsiz) and memory mapping window base (mmwbr) registers, respectively. the memory mapping window control registers, mm1cr and mm2cr, select the particular bank or page of expanded memory present in the window(s) at a given time. note: throughout this manual, the registers are discussed by function. in the event that not all bits in a register are referenced, the bits that are not discussed are shaded. 11.3.2.1 port g assignment register the port g assignment register (pgar) sets each of port g pins 5:0 as either an input/output (i/o) pin or memory expansion address line. clearing a bit configures the corresponding port g pin as gpio; setting the bit configures the pin as an expansion address line. if neither bank uses a particular expansion address bit, the corresponding pin is available for gpio. note: a special case exists for the address lines that overlap the cpu address lines xa[15:13]. if these lines are selected as expansion address lines in pgar, but are not used in either window, the corresponding cpu address line is still output on the appropriate pin. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects memory expansion m68hc11k family technical data motorola memory expansion and chip selects 235 pgar[5:0] ? port g pin assignment bits 0 = corresponding port g pin is gpio. 1 = corresponding port g pin is expansion address line xa[18:13]. 11.3.2.2 memory mapping size register the memory mapping size register (mmsiz) sets the size of the windows in use. w2sz[1:0] ? window 2 size bit w1sz[1:0] ? window 1 size bit these bits enable the memory windows and determine their size, as shown in table 11-2 . address: $002d bit 7654321bit 0 read: ? ? pgar5 pgar4 pgar3 pgar2 pgar1 pgar0 write: reset:00000000 figure 11-1. port g assignment register (pgar) address: $0056 bit 7654321bit 0 read: mxgs2 mxgs1 w2sz1 w2sz0 0 0w1sz1w1sz0 write: reset:00000000 figure 11-2. memory mapping size register (mmsiz) table 11-2. window size select wxsz[1:0] window size 00 window disabled 01 8 k ? window can have up to 64 8-kbyte banks 10 16 k ? window can have up to 32 16-kbyte banks 11 32 k ? window can have up to 16 32-kbyte banks f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 236 memory expansion and chip selects motorola memory expansion and chip selects 11.3.2.3 memory mapping window base register the memory mapping window base register (mmwbr) defines the starting address of each of the two windows within the cpu 64-kbyte address range. the windows normally begin at a boundary related to their size (an 8-kbyte window can begin on any 8-kbyte boundary, beginning at $0000). w2a[15:13] ? window 2 base address bits selects the three most significant bits (msb) of the base address for memory mapping window 2. refer to table 11-3 . w1a[15:13] ? window base 1 address bits selects the three msb of the base address for memory mapping window 1. refer to table 11-3 . address: $0057 bit 7654321bit 0 read: w2a15 w2a14 w2a13 0 w1a15 w1a14 w1a13 0 write: reset:00000000 figure 11-3. memory mapping window base register (mmwbr) table 11-3. memory expansion window base address msb bits window base address wxa[15:13] 8 kbytes 16 kbytes 32 kbytes 000 $0000 $0000 $0000 001 $2000 $0000 $0000 010 $4000 $4000 $4000 011 $6000 $4000 $4000 100 $8000 $8000 $8000 101 $a000 $8000 $8000 110 $c000 $c000 $8000 111 $e000 $c000 $8000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects memory expansion m68hc11k family technical data motorola memory expansion and chip selects 237 11.3.2.4 memory mapping window control registers each of the memory mapping window control registers (mm1cr and mm2cr) determine the active memory bank for the corresponding window, containing the value to be output on the expansion address lines when the cpu selects addresses within its extended memory window. to change banks, write the address of the new bank into the appropriate window register. x1a[18:13] ? memory mapping window 1 expansion address line select bits x2a[18:13] ? memory mapping window 2 expansion address line select bits each bit value written to the mmxcr registers is driven on the corresponding port g expansion address line (if enabled by pgar) to enable the specified bank in the window. address: $0058 memory mapping window 1 control register (mm1cr) bit 7654321bit 0 read: 0 x1a18 x1a17 x1a16 x1a15 x1a14 x1a13 0 write: reset:00000000 address: $0059 memory mapping window 2 control register (mm1cr) read: 0 x2a18 x2a17 x2a16 x2a15 x2a14 x2a13 0 write: reset:00000000 figure 11-4. memory mapping window control registers (mm1cr and mm2cr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 238 memory expansion and chip selects motorola memory expansion and chip selects 11.4 chip selects the m68hc11k family microcontrollers contain a set of four software-configured chip select signals which can reduce the amount of external glue logic needed to interface the mcu to external devices in the memory map. each chip select signal is asserted when the cpu accesses a memory location in its designated range, which is determined by writes to control registers. polarity of most chip-select signals is programmable, as well as the segment of the address cycle during which the signal is asserted (high e clock or address valid). some chip-select signals can be programmed to drive each other as well as their own designated sections of memory (see 11.4.4 one chip select driving another ), and the bus cycle during which any chip-select signal is asserted can be ? stretched ? up to three clock cycles (see 11.4.5 clock stretching ). the four chip-select signals operate only in expanded modes. the program chip select (csprog ) is used to enable external memory in the 64-kbyte memory map that contains the reset vectors and program. the chip select for i/o (csio) operates only within the first eight kbytes of the memory map. the two general-purpose chip selects, csgp1 and csgp2, can enable devices anywhere in the 1-mbyte expanded memory space. any port h pins 4-7 that are not used for chip-select functions can serve as gpio pins. the six chip select control registers are:  csctl enables and controls most of the features in csprog and csio.  gpcs1a, gpcs1c, gpcs2a, and gpcs2c define most of the operations of the two general-purpose chip selects.  cscstr controls clock stretching for all four signals. table 11-4 summarizes the controls for each of the chip-select signals. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects chip selects m68hc11k family technical data motorola memory expansion and chip selects 239 table 11-4. chip select control parameter summary csio enable ioen in csctl 1 = enabled, 0 = disabled (1) valid iocsa in csctl 1 = address valid, 0 (1) = e high polarity iopl in csctl 1 = active high, 0 = active low (1) size iosz in csctl 1 = 4 k ($1000 ? $1fff) 0 = 8 k ($0000 ? $1fff) (1) start address fixed (see size) stretch io1s[a:b] in cscstr 0 (1) , 1, 2, or 3 e clocks csprog enable pcsen in csctl 1 = enabled (1) , 0 = disabled valid fixed (address valid) polarity fixed (active low) size pcsz[a:b] in csctl 0:0 = 64 k ($0000 ? $ffff) (1) 0:1 = 32 k ($8000 ? $ffff) 1:0 = 16 k ($c000 ? $ffff) 1:1 = 8 k ($e000 ? $ffff) start address fixed (see size) stretch pcs[a:b] in cscstr 0 (1) , 1, 2, or 3 e clocks priority gcspr in csctl 1 = csgpx above csprog 0 (1) = csprog above csgpx csgp1, enable set size to 0k to disable csgp2 val id g1av in gpcs1c g2av in gpcs2c 1 = address valid, 0 = e high (1) polarity g1pol in gps1c g2pol in gps2c 1 = active high, 0 = active low (1) size g1sz[a:d] in gpcs1c g1sz[a:d] in gpcs2c 2 k to 512 k in nine steps 0k = disabled (1) can also follow memory expansion window 1 or window 2 start address gpcs1a gpcs2a stretch cscstr 0 (1) , 1, 2, or 3 e clocks other g1dg2 in gpcs1c allows csgp1 and csgp2 to be logically ored and driven out the csgp2 pin g1dpc in gpcs1c allows csgp1 and csprog to be logically ored and driven out the csprog pin g2dpc in gpcs2c allows csgp2 and csprog to be logically ored and driven out the csprog pin. mxgs2 in mmsiz allows csgp2 to follow either 64 k cpu addresses or 512k expansion addresses mxgs1 in mmsiz allows csgp1 to follow either 64 k cpu addresses or 512k expansion addresses 1. configuration at reset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 240 memory expansion and chip selects motorola memory expansion and chip selects 11.4.1 program chip select the program chip select signal accesses external memory in the main program area within the mcu ? s 64-kbyte memory map. program chip select validity is fixed at address valid timing and polarity is fixed at active low. the chip-select control register (csctl) contains bits to enable csprog , determine its priority over the general-purpose chip selects, and set its effective address range. clock stretching can be set from zero to three cycles. gcspr ? general-purpose chip select priority bit 0 = program chip select has priority over general-purpose chip selects 1 = general-purpose chip selects have priority over program chip select pcsen ? program chip select enable bit 0 = csprog disabled and port h bit 7 available as gpio 1 = csprog enabled out of reset and uses port h bit 7 pin pcsza and pcszb ? program chip select size a bit and program chip select size b bit these bits determine the address range of csprog , as shown in table 11-5 . address: $005b bit 7654321bit 0 read: ioen iopl iocsa iosz gcspr pcsen pcsza pcszb write: reset:00000100 figure 11-5. chip-select control register (csctl) table 11-5. program chip select size pcsza pcszb size (bytes) address range 0 0 64 k $0000 ? $ffff 0 1 32 k $8000 ? $ffff 1 0 16 k $c000 ? $ffff 1 1 8 k $e000 ? $ffff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects chip selects m68hc11k family technical data motorola memory expansion and chip selects 241 11.4.2 input/output chip select the i/o chip select (csio) is programmable for a 4-kbyte size located at addresses $1000 ? $1fff or 8-kbyte size located at addresses $0000 ? $1fff. the default active-low polarity can be changed to active high by setting the iopl bit in csctl. default validity during high e clock can be changed to address valid time by setting the iocsa bit in csctl. clock stretching can be set from zero to three cycles (see 11.4.5 clock stretching ). csio is disabled out of reset. ioen ? i/o chip-select enable bit 0 = csio is disabled and port h bit 4 is gpio. 1 = csio is enabled and uses port h bit 4. iopl ? i/o chip-select polarity select bit 0 = csio active low 1 = csio active high iocsa ? i/o chip-select address valid bit 0 = csio is valid during e-clock high time. 1 = csio is valid during address valid time. iosz ? i/o chip-select size select bit 0 = csio size is four kbytes at $1000 ? $1fff. 1 = csio size is eight kbytes at $0000 ? $1fff. address: $005b bit 7654321bit 0 read: ioen iopl iocsa iosz gcspr pcsen pcsza pcszb write: reset:00000100 figure 11-6. chip-select control register (csctl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 242 memory expansion and chip selects motorola memory expansion and chip selects 11.4.3 general-purpose chip selects the general-purpose chip selects are the most flexible and programmable of the chip-select signals. they can access any memory in the expanded 1-mbyte address space. polarity of active state, e valid or address valid, size, and starting address are all programmable. clock stretching can be set from zero to three cycles. both signals can be programmed to drive csprog, and gpcs1 can be configured to drive gpcs2. in addition, each signal can follow a window; for instance, be asserted whenever the cpu address falls within a selected memory expansion window regardless of the state of the expanded address lines. there are two registers for each of the general-purpose chip select signals:  the control register, gps1c or gps2c, determines the gpcs ? s active signal polarity, its valid time, which of the other chip-select signals it can drive, and either the size of the memory it enables or which window it follows.  the address register, gps1a or gps2a, programs the chip-select ? s starting address; valid bits in this register are determined by the size of the address range selected by the control register. in addition, the mmsiz register contains a bit for each gpcs which determines whether it is driven by the cpu ? s 64-kbyte address lines or the expansion address lines. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects chip selects m68hc11k family technical data motorola memory expansion and chip selects 243 11.4.3.1 memory mapping size register mxgs2 ? memory expansion select for gpcs 2 bit 0 = gpcs 2 based on 64-kbyte cpu address 1 = gpcs 2 based on expansion address mxgs1 ? memory expansion select for gpcs 1 bit 0 = gpcs 1 based on 64-kbyte cpu address 1 = gpcs 1 based on expansion address 11.4.3.2 general-purpose chip select 1 address register g1a[18:11] ? general-purpose chip select 1 address bits they select the starting address of gpcs1. refer to table 11-6 . address: $0056 bit 7654321bit 0 read: mxgs2 mxgs1 w2sz1 w2sz0 0 0 w1sz1 w1sz0 write: reset:00000000 figure 11-7. memory mapping size register (mmsiz) address: $005c bit 7654321bit 0 read: g1a18 g1a17 g1a16 g1a15 g1a14 g1a13 g1a12 g1a11 write: reset:00000000 figure 11-8. general-purpose chip select 1 address register (gpcs1a) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 244 memory expansion and chip selects motorola memory expansion and chip selects 11.4.3.3 general-purpose chip select 1 control register g1pol ? general-purpose chip select 1 polarity select bit 0 = csgp1 active low 1 = csgp1 active high g1av ? general-purpose chip select 1 address valid select bit 0 = csgp1 is valid during e high time. 1 = csgp1 is valid during address valid time. g1sz[a:d] ? general-purpose chip select 1 size bits they select the range of gpcs1. refer to table 11-6 . address: $005d bit 7654321bit 0 read: g1dg2 g1dpc g1pol g1av g1sza g1szb g1scc g1szd write: reset:00000000 figure 11-9. general-purpose chip select 1 control register (gpcs1c) table 11-6. general-purpose chip select 1 size control g1sz[a:d] size (bytes) valid bits (mxgs1 = 0) valid bits (mxgs1 = 1) 0 0 0 0 disabled none none 0 0 0 1 2 k g1a[15:11] g1a[18:11] 0 0 1 0 4 k g1a[15:11] g1a[18:12] 0 0 1 1 8 k g1a[15:13] g1a[18:13] 0 1 0 0 16 k g1a[15:14] g1a[18:14] 0 1 0 1 32 k g1a[15] g1a[18:15] 0 1 1 0 64 k none g1a[18:16] 0 1 1 1 128 k none g1a[18:17] 1 0 0 0 256 k none g1a18 1 0 0 1 512 k none none 1 0 1 0 follow window 1 none none 1 0 1 1 follow window 2 none none 1100 ? 1111 default to 512 k none n one f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects chip selects m68hc11k family technical data motorola memory expansion and chip selects 245 11.4.3.4 general-purpose chip select 2 address register g2a[18:11] ? general-purpose chip select 2 address bits they select the starting address of gpcs2. refer to table 11-7 . 11.4.3.5 general-purpose chip select 2 control register g2pol ? general-purpose chip select 2 polarity select bit 0 = csgp2 active low 1 = csgp2 active high g2av ? general-purpose chip select 2 address valid select bit 0 = csgp2 is valid during e high time. 1 = csgp2 is valid during address valid time. g2sz[a:d] ? general-purpose chip select 2 size bits they select the range of gpcs2. refer to table 11-7 . address: $005e bit 7654321bit 0 read: g2a18 g2a17 g2a16 g2a15 g2a14 g2a13 g2a12 g2a11 write: reset:00000000 figure 11-10. general-purpose chip select 2 address register (gpcs2a) address: $005f bit 7654321bit 0 read: 0 g2dpc g2pol g2av g2sza g2szb g2szc g2szd write: reset:00000000 figure 11-11. general-purpose chip select 2 control register (gpcs2c) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 246 memory expansion and chip selects motorola memory expansion and chip selects 11.4.4 one chip select driving another the general-purpose chip selects can be programmed to drive other chip-select signals as well as their own memory areas. although all of the eight possible combinations of the bits g1dg2, g1dpc, and g2dpc are allowed, some combinations cause operations which do not perform as one might expect. the results of all combinations are defined in table 11-8 . the priorities defined in the previous sections still apply. the table assumes that none of the chip-select ranges overlap. table 11-7. general-purpose chip select 2 size control g2sz[a:d] size (bytes) valid bits (mxgs2 = 0) valid bits (mxgs2 = 1) 0 0 0 0 disabled none none 0 0 0 1 2 k g2a[15:11] g2a[18:11] 0 0 1 0 4 k g2a[15:11] g2a[18:12] 0 0 1 1 8 k g2a[15:13] g2a[18:13] 0 1 0 0 16 k g2a[15:14] g2a[18:14] 0 1 0 1 32 k g2a[15] g2a[18:15] 0 1 1 0 64 k none g2a[18:16] 0 1 1 1 128 k none g2a[18:17] 1 0 0 0 256 k none g2a18 1 0 0 1 512 k none none 1 0 1 0 follow window 1 none none 1 0 1 1 follow window 2 none none 1100 ? 1111 default to 512 k none n one f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects chip selects m68hc11k family technical data motorola memory expansion and chip selects 247 11.4.4.1 general-purpose chip select 1 control register g1dg2 ? gpcs 1 drives gpcs 2 bit 0 = csgp1 does not affect csgp2. 1 = csgp1 and csgp2 are ored and driven out of the csgp2. g1dpc ? general-purpose chip select 1 drives program chip select bit 0 = csgp1 does not affect csprog. 1 = csgp1 and csprog are ored and driven out of the csprog. 11.4.4.2 general-purpose chip select 2 control register g2dpc ? general-purpose chip select 2 drives program chip select bit 0 = does not affect program chip select 1 = csgp2 and csprog are ored and driven out of the csprog pin. address: $005d bit 7654321bit 0 read: g1dg2 g1dpc g1pol g1av g1sza g1szb g1scc g1szd write: reset:00000000 figure 11-12. general-purpose chip select 1 control register (gpcs1c) address: $005f bit 7654321bit 0 read: 0g2dpc g2pol g2av g2sza g2szb g2szc g2szd write: reset:00000000 figure 11-13. general-purpose chip select 2 control register (gpcs2c) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 248 memory expansion and chip selects motorola memory expansion and chip selects 11.4.5 clock stretching chip select and bus control signals are synchronized with the external e clock. to accommodate devices that are slower than the mcu, the e clock can be stretched when a chip select is asserted so that it remains high for one to three extra bus cycles. during this stretch, which can occur only during accesses to addresses in that chip select ? s address range, the other clocks continue running normally, maintaining the integrity of the timers and baud generators. each chip select has two associated bits in the chip-select clock stretch (cscstr) register that set its clock stretching from zero (disabled) to three cycles. table 11-8. one chip select driving another g1dg2 g1dpc g2dpc program cs pin is asserted when address is in: general 2 cs pin is asserted when address is in: general 1 cs pin is asserted when address is in: 0 0 0 a valid program area a valid general 2 area a valid general 1 area 001 a valid program or general 2 area never asserted a valid general 1 area 010 a valid program or general 1 area a valid general 2 area never asserted 011 a valid program or general 1 or 2 area never asserted never asserted 1 0 0 a valid program area a valid general 2 or general 1 area never asserted 101 a valid program or general 2 area never asserted a valid general 1 area 110 a valid program or general 1 area a valid general 2 area never asserted 111 a valid program or general 1 or 2 area never asserted never asserted f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects memory expansion examples m68hc11k family technical data motorola memory expansion and chip selects 249 ios[a:b] ? csio stretch select bits gp1s[a:b] ? csgp1 stretch select bits gp2s[a:b] ? csgp2 stretch select bits pcs[a:b] ? csprog stretch select bits each of these pairs of bits contain the binary number of cycles of clock stretch, as shown in table 11-9 . 11.5 memory expansion examples the first example, shown in figure 11-15 contains a system with 64 kbytes of external memory to be accessed through a single 8-kbyte window. to access eight kbytes, or 2 13 address locations, the cpu will need 13 address lines, addr[12:0]. the number of memory banks needed is the total memory, 64 kbytes divided by the window size, eight kbytes. this yields eight memory banks, or 2 3 . thus, three expansion lines are required, so expansion address lines xa[15:13] replace cpu address lines addr[15:13]. figure 1-1 shows a memory map and schematic drawing of this system. address: $005a bit 7654321bit 0 read: iosa iosb gp1sa gp1sb gp2sa gp2sb pcsa pcsb write: reset:00000000 figure 11-14. chip select clock stretch register (cscstr) table 11-9. cscstr bits versus clock cycles bit [a:b] clock stretch 0 0 none 0 1 1 cycle 1 0 2 cycles 1 1 3 cycles f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 250 memory expansion and chip selects motorola memory expansion and chip selects figure 11-15. memory expansion example 1 ? memory map for a single 8-kbyte window with eight banks of external memory internal (ep)rom $04000 bank 0 xa[15:13] = 0:0:0 $0000 $1000 $4000 $6000 $a000 $ffff window 1 chip select 1 pgar = $07 xa[15:13] mmwbr = $04 window 1 @ $4000 window 2 disabled mmsiz = $41 window 1 = 8 kbytes window 2 disabled general-purpose chip select 1 based on expanded address csctl = $00 no i/o or program chip selects gpcs1a = $00 general-purpose chip select 1 starting address = $00000 gpcs1c = $06 64 kbyte range (8 x 8 k) gpcs2a = $00 n/a gpcs2c = $00 general-purpose chip select 2 disabled 27c512 mc68hc(7)11k gpcs2 gpcs1 e r/w $05fff $14000 bank 1 xa[15:13] = 0:0:1 $15fff $24000 bank2 xa[15:13] = 0:1:0 $25fff $34000 bank 3 xa[15:13] = 0:1:1 $35fff $44000 bank 4 xa[15:13] = 1:0:0 $45fff $54000 bank 5 xa[15:13] = 1:0:1 $55fff $64000 bank6 xa[15:13] = 1:1:0 $65fff $74000 bank 7 xa[15:13] = 1:1:1 $75fff ee/reg/ram addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 addr11 addr10 addr9 addr8 addr11 addr10 addr9 addr8 addr15 addr14 addr13 addr12 addr12 data7 data6 data5 data4 data3 data2 data1 data0 data7 data6 data5 data4 data3 data2 data1 data0 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 a7 a6 a5 a4 a3 a2 a1 a0 addr8 a8 addr11 addr10 addr9 a11 a10 a9 a12 addr12 xa15 xa14 xa13 a15 a14 a13 v ss oe ce v cc v dd xa13 xa13 xa15 xa14 xa17 xa16 xa15 xa14 xa18 data7 data6 data5 data4 data3 data2 data1 data0 d7 d6 d5 d4 d3 d2 d1 d0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory expansion and chip selects memory expansion examples m68hc11k family technical data motorola memory expansion and chip selects 251 the second example system shown in figure 11-16 contains two memory windows. the first window is organized as in the previous example, 8 banks of 8 kbytes each. the second window accesses 256 kbytes of memory in 16 banks of 16 kbyte each. to access 16 kbytes, or 2 14 address locations, the cpu will need 14 address lines, addr[13:0]. since addr13 is driven on xa13 in this example, xa13 replaces addr13 to drive the a13 line in the 6226 devices, but addr13 could be used as well. 16 (2 4 ) memory banks require four expansion address lines, a[17:14]. refer to figure 11-16 for a memory map and schematic drawing of this system. figure 11-16. memory expansion example 2 (sheet 1 of 2) memory map for one 8-kbyte window with eight banks and one 16-kbyte window with 16 banks of external memory xa[17:14] = 0:0:0:0 internal (ep)rom $0000 $1000 $4000 $6000 $a000 $ffff window 1 chip ee/reg/ram window 2 $08000 bank 0 $0bfff $18000 bank 1 $1bfff $28000 bank 2 $2bfff $38000 bank 3 $3bfff $48000 bank 4 xa[17:14] = 0:1:0:0 $4bfff $f8000 bank 15 xa[17:14] = 1:1:1:1 $fbfff select 1 chip select 2 $8000 $c000 pgar = $1f xa[17:13] csctl = $00 no i/o or program chip selects mmwbr = $84 window 1 @ $4000 gpcs1a = $00 general-purpose chip select 1 from $00000 window 2 @ $8000 gpcs1c = $06 64 kbyte range (8 x 8 k) mmsiz = $e1 window 1 = 8 kbytes gpcs2a = $00 general-purpose chip select 2 from $00000 window 2 = 16 kbytes gpcs2c = $08 256 kbyte range (16 x 16 k) gpcs1, gpcs2 based on expansion address $04000 bank 0 xa[15:13] = 0:0:0 $05fff $14000 bank 1 xa[15:13] = 0:0:1 $15fff $24000 bank2 xa[15:13] = 0:1:0 $25fff $34000 bank 3 xa[15:13] = 0:1:1 $35fff $44000 bank 4 xa[15:13] = 1:0:0 $45fff $54000 bank 5 xa[15:13] = 1:0:1 $55fff $64000 bank6 xa[15:13] = 1:1:0 $65fff $74000 bank 7 xa[15:13] = 1:1:1 $75fff xa[17:14] = 0:0:0:1 xa[17:14] = 0:0:1:0 xa[17:14] = 0:0:1:1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 252 memory expansion and chip selects motorola memory expansion and chip selects figure 11-16. memory expansion example 2 (sheet 2 of 2) memory map for one 8-kbyte window with eight banks and one 16-kbyte window with 16 banks of external memory mc68hc(7)11k 6226 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 addr11 addr10 addr9 addr8 addr11 addr10 addr9 addr8 data7 data6 data5 data4 data3 data2 data1 data0 data7 data6 data5 data4 data3 data2 data1 data0 xa13 xa13 xa17 xa16 xa15 xa14 xa17 xa16 xa15 xa14 addr15 addr14 addr13 addr12 xa18 addr12 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 a7 a6 a5 a4 a3 a2 a1 a0 addr8 a8 addr11 addr10 addr9 a11 a10 a9 a12 addr12 xa15 xa14 xa13 a15 a14 a13 xa16 a16 (low) data7 data6 data5 data4 data3 data2 data1 data0 d7 d6 d5 d4 d3 d2 d1 d0 v ss oe e1 v cc v dd w e2 6226 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 a7 a6 a5 a4 a3 a2 a1 a0 addr8 a8 addr11 addr10 addr9 a11 a10 a9 a12 addr12 xa15 xa14 xa13 a15 a14 a13 xa16 a16 (high) data7 data6 data5 data4 data3 data2 data1 data0 d7 d6 d5 d4 d3 d2 d1 d0 v ss oe e1 v cc v dd w 27c512 data7 data6 data5 data4 data3 data2 data1 data0 d7 d6 d5 d4 d3 d2 d1 d0 v ss oe ce v cc v dd r/w gpcs2 gpcs1 addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 a7 a6 a5 a4 a3 a2 a1 a0 addr8 a8 addr11 addr10 addr9 a11 a10 a9 a12 addr12 xa15 xa14 xa13 a15 a14 a13 e xa17 xa17 e2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola electrical characteristics 253 technical data ? m68hc11k family section 12. electrical characteristics 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .254 12.3 maximum ratings for standard devices . . . . . . . . . . . . . . . .254 12.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . .255 12.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255 12.6 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .256 12.7 power dissipation characteristics . . . . . . . . . . . . . . . . . . . . . 257 12.8 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .259 12.9 peripheral port timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263 12.10 analog-to-digital converter characteristics . . . . . . . . . . . . . .265 12.11 expansion bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 12.12 serial peripheral interface timing . . . . . . . . . . . . . . . . . . . . .269 12.13 eeprom characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . .272 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 254 electrical characteristics motorola electrical characteristics 12.2 introduction this section contains electrical parameters for standard and extended voltage devices. when applicable, extended voltage parameters are shown separately. diagrams apply to both standard and extended voltage devices. 12.3 maximum ratings for standard devices maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. note: this device is not guaranteed to operate properly at the maximum ratings. refer to 12.6 electrical characteristics for guaranteed operating conditions. note: this device contains circuitry to protect the inputs against damage due to high static voltages or electric fields; however, it is advised that normal precautions be taken to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. for proper operation, it is recommended that v in and v out be constrained to the range v ss (v in or v out ) v dd . reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (for example, either v ss or v dd ). rating symbol value unit supply voltage v dd ? 0.3 to +7.0 v input voltage v in ? 0.3 to +7.0 v current drain per pin (1) excluding v dd , v ss , av dd , v rh , and v rl 1. one pin at a time, observing maximum power dissipation limits i d 25 ma storage temperature t stg ? 55 to +150 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics functional operating range m68hc11k family technical data motorola electrical characteristics 255 12.4 functional operating range 12.5 thermal characteristics rating symbol value unit operating temperature range mc68hc(7)11kc mc68hc(7)11kv mc68hc(7)11km t a t l to t h ? + ? + ? + + + + + + f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 256 electrical characteristics motorola electrical characteristics 12.6 electrical characteristics characteristic (1) 1. v dd = 5.0 vdc ? v dd ? 0.1 0.1 ? v output high voltage, i load = ? 0.8 ma, v dd = 4.5 v (2) all outputs except xtal, reset , and moda v oh v dd ? 0.8 ? v output low voltage, i load = 1.6 ma all outputs except xtal v ol ? 0.4 v input high voltage all inputs except reset reset v ih 0.7 x v dd 0.8 x v dd v dd + 0.3 v dd + 0.3 v input low voltage all inputs v il v ss ? 0.3 0.2 x v dd v i/o ports, three-state leakage, v in = v ih or v il ports a, b, c, d, f, g, h, moda/lir , reset i oz ? ? ? ? 10 ? ? 8 12 pf output load capacitance all outputs except pd[4:1], xout, xtal, moda/lir pd[4:1] xout c l ? ? ? 90 200 30 pf f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics power dissipation characteristics m68hc11k family technical data motorola electrical characteristics 257 12.7 power dissipation characteristics characteristic symbol 2 mhz 3 mhz 4 mhz unit maximum total supply current (1) run: single-chip mode expanded mode slow mode 1. extal is driven with a square wave; t cyc = 500 ns for 2 mhz rating; t cyc = 250 ns for 4 mhz rating; v il ? 0.2 v; no dc loads i dd 27 35 6.5 33 42 7.0 40 50 7.5 ma wait: (all peripheral functions shut down) single-chip mode expanded mode slow mode wi dd 10 12 3.5 15 17 4.5 20 22 5.5 ma stop: ( no clocks) single-chip mode si dd 50 50 50 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 258 electrical characteristics motorola electrical characteristics figure 12-1. test methods clocks, strobes inputs ~ v dd spec outputs ac testing ~ v ss ~ v dd clocks, strobes inputs 0.4 volts ~ v dd 70% of v dd v dd ? 0.8 volts 0.4 volts outputs 0.4 volts dc testing ~ v ss v dd ? 0.8 volts nominal 20% of v dd ~ v dd 20% of v dd 70% of v dd 20% of v dd v dd ? 0.8 volts 0.4 volts 70% of v dd 20% of v dd ~ v ss 20% of v dd 70% of v dd see note 2 notes: 1. full test loads are applied during all dc electrical tests and ac timing measurements. 2. during ac timing measurements, inputs are driven to 0.4 volts and v dd ? 0.8 volts while timing measurements are taken at the 20% and 70% of v dd points. timing nominal timing nominal timing timing spec timing spec timing ~ v ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics control timing m68hc11k family technical data motorola electrical characteristics 259 12.8 control timing figure 12-2. timer inputs characteristic (1) 1. v dd = 4.5 to 5.5 vdc for standard devices, v ss = 0 vdc, t a = t l to t h all timing measurements refer to 20% v dd and 70% v dd , unless otherwise noted. symbol 1.0 mhz 2.0 mhz 3.0 mhz 4.0 mhz unit min max min max min max min max frequency of operation f o dc 1.0 dc 2.0 dc 3.0 dc 4.0 mhz e-clock period t cyc 1000 ? 500 ? 333 ? 250 ? ns crystal frequency f xtal ? 4.0 ? 8.0 ? 12.0 ? 16.0 mhz external oscillator frequency 4 f o dc 4.0 dc 8.0 dc 12.0 dc 16.0 mhz processor control setup time t pcsu = 1/4 t cyc + 50 ns t pcsu = 1/4 t cyc + 75 ns (extended voltage devices) t pcsu 300 325 ? ? 175 200 ? ? 133 158 ? ? 112 ? ? ? ns reset input pulse width (2) to guarantee external reset vector minimum input time (3) 2. reset is recognized during the first clock cycle it is held low. internal circuitry then drives the pin low for eight clock cycles, releases the pin, and samples the pin level two cycles later to determine the source of the interrupt. 3. can be pre-empted by internal reset pw rstl 16 1 ? ? 16 1 ? ? 16 1 ? ? 16 1 ? ? t cyc mode programming setup time t mps 2 ? 2 ? 2 ? 2 ? t cyc mode programming hold time t mph 10 ? 10 ? 10 ? 10 ? ns interrupt pulse width, irq edge-sensitive mode pw irq = t cyc + 20 ns pw irq 1020 ? 520 ? 353 ? 270 ? ns wait recovery startup time t wrs ? 4 ? 4 ? 4 ? 4 t cyc timer pulse width pw tim = t cyc + 20 ns input capture, pulse accumulator pw tim 1020 ? 520 ? 353 ? 270 ? ns pa7 2,3 pa7 1,3 pa[3:0] 2 pa[3:0] 1 notes: 1. rising edge sensitive input 2. falling edge sensitive input 3. maximum pulse accumulator clocking rate is e-clock frequency divided by 2. pw tim f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 260 electrical characteristics motorola electrical characteristics figure 12-3. por external reset timing diagram t pcsu address moda, modb e extal v dd reset 4064 t cyc fffe fffe fffe new pc fffe ffff fffe fffe fffe new pc fffe ffff fffe t mph pw rstl t mps f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola electrical characteristics 261 electrical characteristics control timing figure 12-4. stop recovery timing diagram pw irq t stopdelay 3 irq 1 irq 2 or xirq e sp ? 8 sp ? 8 fff2 (fff4) new pc stop addr stop addr + 1 address 4 stop addr stop addr + 1 stop addr + 1 stop addr + 1 stop addr + 2 sp ? sp ? 7 fff3 (fff5) opcode resume program with instruction internal address 5 clocks notes: 1. edge-sensitive irq pin (irqe bit = 1) 2. level-sensitive irq pin (irqe bit = 0) 3. t stopdelay = 4064 t cyc if dly bit = 1 or 4 t cyc if dly = 0 4. xirq with x bit in ccr = 1 5. irq or xirq with x bit in ccr = 0 which follows the stop instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 262 electrical characteristics motorola electrical characteristics figure 12-5. wait recovery from inerrupt timing diagram figure 12-6. interrupt timing diagram addr + 1 t pcsu pcl, pch, yl, yh, xl, e r/w address wait addr wait addr + 1 sp sp ? 1 sp ? 2 ? sp ? 8 sp ? 8 sp ? 8 ? sp ? 8 sp ? 8sp ? 8sp ? 8 vector addr vector new pc t wrs note: reset also causes recovery from wait. irq , xirq , or internal interrupts xh, a, b, ccr stack registers e pw irq sp ? 8 sp ? 8 address new pc next opcode next op + 1 irq 1 vector addr sp ? 7 t pcsu irq 2 , xirq , or internal interrupt sp sp ? 1sp ? 2 sp ? 3sp ? 4sp ? 5 sp ? 6 vector addr + 1 op code ? ? data pcl pch iyl iyh ixl ixh b a ccr ? ? vect msb vect lsb op code r/w notes: 1. edge-sensitive irq pin (irqe bit = 1) 2. level-sensitive irq pin (irqe bit = 0) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics peripheral port timing m68hc11k family technical data motorola electrical characteristics 263 12.9 peripheral port timing characteristic (1) 1. v dd = 4.5 to 5.5 vdc for standard devices, v ss = 0 vdc, t a = t l to t h all timing measurements refer to 20% v dd and 70% v dd , unless otherwise noted. symbol 1.0 mhz 2.0 mhz 3.0 mhz 4.0 mhz unit min max min max min max min max frequency of operation (e clock) f o dc 1.0 dc 2.0 dc 3.0 dc 4.0 mhz e-clock period t cyc 1000 ? 500 ? 333 ? 250 ? ns peripheral data setup time (2) mcu read of ports a, b, c, d, e, f, g, and h 2. ports c and d timing is valid only in active drive mode. (cwom and dwom bits are cleared in opt2 and spcr registers, respectively.) t pdsu 100 100 100 100 ns peripheral data hold time mcu read of ports a, b, c, d, e, f, g, and h t pdh 50 ? 50 ? 50 ? 50 ? ns delay time, peripheral data write standard devices mcu write to port a, b, g, and h mcu write to ports c, d, and f (t pwd = 1/4 t cyc + 100 ns) extended voltage mcu write to port a, b, g, and h mcu write to ports c, d, and f (t pwd = 1/4 t cyc + 150 ns) t pwd ? ? ? ? 200 350 250 400 ? ? ? ? 200 225 250 225 ? ? ? ? 200 183 250 233 ? ? ? ? 200 162 ? ? ns f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 264 electrical characteristics motorola electrical characteristics figure 12-7. port read timing diagram figure 12-8. port write timing diagram mcu read of port t pdsu t pdsu t pdh t pdh e ports a, c, d, f ports b, e, g mcu write to port t pwd e ports c, d, f ports a, b, g, h t pwd previous port data previous port data new data valid new data valid f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics analog-to-digital converter characteristics m68hc11k family technical data motorola electrical characteristics 265 12.10 analog-to-digital converter characteristics characteristic (1) parameter min absolute max unit f o ? 8 ?? bits non-linearity maximum deviation from the ideal a/d transfer characteristics ?? ?? ?? ?? ?? ?? ? v rh v rh v v rh maximum analog reference voltage (3) v rl ? v dd + 0.1 v dd + 0.1 v v rl minimum analog reference voltage (3) v ss ? 0.1 ? v rh v rh v ? ??? v conversion time total time to perform a single analog-to-digital conversion: e clock internal rc oscillator ? ? 32 ? ? t cyc + 32 ? t cyc + 32 t cyc ??? hex full scale reading conversion result when v in = v rh ?? ff ff hex continued f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 266 electrical characteristics motorola electrical characteristics sample acquisition time analog input acquisition sampling time: e clock internal rc oscillator ? ? 12 ? ? 12 ? 12 t cyc ? 20 (typ) ?? pf input leakage input leakage on a/d pins pe[7:0] v rl , v rh ? ? ? ? 400 1.0 400 1.0 na ? ? ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics expansion bus timing m68hc11k family technical data motorola electrical characteristics 267 12.11 expansion bus timing num characteristic (1) 1. v dd = 5.0 ? 333 ? 250 ? ns 2 pulse width, e low, pw el = 1/2 t cyc ? 20 ns pw el 230 ? 147 ? 105 ? ns 3 pulse width, e high (3) pw eh = 1/2 t cyc ? ? 142 ? 100 ? ns 4a 4b e clock rise time fall time t r t f ? ? 20 20 ? ? 20 18 ? ? 20 15 ns 9 address hold time, t ah = 1/8 t cyc ? ? 32 ? 21 ? ns 11 address delay time, t ad = 1/8 t cyc + ? 103 ? 82 ? 71 ns 12 address valid time to e rise t av = pw el ? ? 65 ? 34 ? ns 17 read data setup time t dsr 30 ? 30 ? 20 ? ns 18 read data hold time t dhr 0 ? 0 ? 0 ? ns 19 write data delay time t ddw ? 40 ? 40 ? 40 ns 21 write data hold time, t dhw = 1/8 t cyc t dhw 63 ? 42 ? 31 ? ns 29 mpu address access time (3) t acca = t cyc ? t f ? t dsr ? t ad t acca 348 ? 203 ? 144 ? ns 39 write data setup time (3) t dsw = pw eh ? ? 102 ? 60 ? ns 50 e valid chip-select delay time t ecsd ? 40 ? 40 ? 40 ns 51 e valid chip-select access time (3) t ecsa = pw eh ? ? ? 72 ? 40 ? ns 52 chip select hold time t ch 020020020ns 54 address valid chip-select delay time t acsd = 1/4 t cyc + 40 ns t acsd ? 165 ? 123 ? 103 ns 55 address valid chip-select access time t acsa = t cyc ? t f ? t dsr ? t acsd (3) t acsa 285 ? 162 ? 113 ? ns 56 address valid to chip-select time t avcs 10 ? 10 ? 10 ? ns 57 address valid to data three-state time t avdz ? 10 ? 10 ? 10 ns f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 268 electrical characteristics motorola electrical characteristics figure 12-9. expansion bus timing e r/w , address read data write data cs e valid cs ad valid 11 2 1 3 12 17 29 19 50 51 39 55 54 4b 9 18 21 52 56 57 4a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics serial peripheral interface timing m68hc11k family technical data motorola electrical characteristics 269 12.12 serial peripheral interface timing num characteristic (1) 1. v dd = 4.5 to 5.5 vdc, v ss = 0 vdc, t a = t l to t h . all timing measurements refer to 20% v dd and 70% v dd , unless otherwise noted. symbol min max unit operating frequency master slave f op(m) f op(s) f o /128 dc f o /2 f o mhz 1 cycle time master slave t cyc(m) t cyc(s) 2 1 128 ? t cyc 2 enable lead time slave t lead(s) 1 ? t cyc 3 enable lag time slave t lag(s) 1 ? t cyc 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s t cyc ? 25 1/2 t cyc ? 25 64 t cyc ? ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s t cyc ? 25 1/2 t cyc ? 25 64 t cyc ? ns 6 data setup time (inputs) master slave t su(m) t su(s) 30 30 ? ? ns 7 data hold time (inputs) master slave t h(m) t h(s) 30 30 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 040ns 9 slave disable time (hold time to high-impedance state) t dis ? 50 ns 10 data valid (after enable edge) (2) 2. capacitive load on all spi pins is 200 pf. t v(s) ? 50 ns 11 data hold time (outputs) (after enable edge) t ho 0 ? ns f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 270 electrical characteristics motorola electrical characteristics a) spi master timing (cpha = 0) b) spi master timing (cpha = 1) figure 12-10. spi timing diagram (sheet 1 of 2) (see note) (see note) msb in bit 6 . . . . . . . 1 lsb in master lsb out bit 6 . . . . . . . 1 master msb out 1 5 5 4 4 7 6 11 10 11 (ref) (input) sck (cpol = 0) output sck (cpol = 1) output miso input mosi output note: this first clock edge is generated internally but is not seen at the sck pin. ss ss is held high on master msb in bit 6 . . . . . . . 1 lsb in master lsb out bit 6 . . . . . . . 1 master msb out 1 5 5 4 4 7 6 11 10 10 (ref) (input) sck (cpol = 0) output sck (cpol = 1) output miso input mosi output note: this last clock edge is generated internally but is not seen at the sck pin. see note see note ss is held high on master ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical characteristics serial peripheral interface timing m68hc11k family technical data motorola electrical characteristics 271 a) spi slave timing (cpha = 0) b) spi slave timing (cpha = 1) figure 12-10. spi timing diagram (sheet 2 of 2) ss msb in bit 6 . . . . . . . 1 lsb in slave lsb out bit 6 . . . . . . . 1 slave msb out 1 5 5 4 4 11 input sck (cpol = 0) input sck (cpol = 1) intput mosi input miso output note: not defined, but normally msb of character just received 8 6 7 10 3 9 11 2 see note msb in bit 6 . . . . . . . . 1 lsb in slave lsb out bit 6 . . . . . . . . . . . 1 slave msb out 1 5 5 4 4 11 input sck (cpol = 0) input sck (cpol = 1) intput mosi input miso output note: not defined, but normally lsb of character previously transmitted 6 7 10 9 2 see note 8 10 3 ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 272 electrical characteristics motorola electrical characteristics 12.13 eeprom characteristics characteristic (1) 1. v dd = 5.0 vdc ? 40 to 85 ? 40 to 105 ? 40 to 125 < f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola mechanical data 273 technical data ? m68hc11k family section 13. mechanical data 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .273 13.3 84-pin plastic-leaded chip carrier (case 780) . . . . . . . . . . .275 13.4 84-pin j-cerquad (case 780a) . . . . . . . . . . . . . . . . . . . . . . .276 13.5 80-pin quad flat pack (case 841b) . . . . . . . . . . . . . . . . . . .277 13.6 80-pin low-profile quad flat pack (case 917a) . . . . . . . . . .278 13.7 68-pin plastic leaded chip carrier (case 779) . . . . . . . . . . .279 13.8 68-pin j-cerquad (case 779a) . . . . . . . . . . . . . . . . . . . . . . .280 13.2 introduction the m68hc11k series microcontrollers are available in:  84-pin plastic-leaded chip carrier (plcc)  84-pin j-cerquad (ceramic windowed version of plcc)  80-pin quad flat pack (qfp)  80-pin low-profile quad flat pack (lqfp)  68-pin plcc  68-pin j-cerquad f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 274 mechanical data motorola mechanical data the diagrams included in this section show the latest package specifications available at the time of this publication. to make sure that you have the latest information, contact one of the following:  local motorola sales office  world wide web at http://www.motorola.com/semiconductors follow the world wide web on-line instructions to retrieve the current mechanical specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data 84-pin plastic-leaded chip carrier (case 780) m68hc11k family technical data motorola mechanical data 275 13.3 84-pin plastic-leaded chip carrier (case 780) notes: 1. datums l, m, and n determined where top of lead shoulder exits package body at mold parting line. 2. dimension g1 to be measured at closest approach of lead to datum t, seating plane. 3. dimensions r and u do not include mold flash. allowable mold flash is 0.010 (0.25) per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. 6. the package top may be smaller than the package bottom by up to 0.012 (0.300). dimensions r and u are determined at the outermost extremes of the plastic body exclusive of mold flash, tie bar burrs, gate burrs and interlead flash, but including any mismatch between the top and bottom of the plastic body. 7. dimension h does not include dambar protrusion or intrusion. the dambar protrusion(s) shall not cause the h dimension to be greater than 0.037 (0.94). the dambar intrusion(s) shall not cause the h dimension to be smaller than 0.025 (0.635). -l- -m- -n- y brk w d d v 84 1 a r g g1 c z j e view s 0.004 (0.10) -t- seating plane s l-m m 0.007 (0.18) t s n b u z 2x x view d-d h k1 k f view s dim min max min max millimeters inches a 1.185 1.195 30.10 30.35 b 1.185 1.195 30.10 30.35 c 0.165 0.180 4.20 4.57 e 0.090 0.120 2.29 3.05 f 0.013 0.021 0.33 0.53 g 0.050 bsc 1.27 bsc h 0.026 0.032 0.66 0.81 j 0.020 --- 0.51 --- k 0.025 --- 0.64 --- r 1.150 1.156 29.21 29.36 u 1.150 1.156 29.21 29.36 v 0.042 0.048 1.07 1.21 w 0.042 0.048 1.07 1.21 x 0.042 0.056 1.07 1.42 y --- 0.020 --- 0.50 z 2 10 2 10 g1 0.545 0.565 13.84 14.35 k1 0.060 --- 1.52 --- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 276 mechanical data motorola mechanical data 13.4 84-pin j-cerquad (case 780a) notes: 1. datums -l-, -m-, -n-, and -p- determined where top of lead shoulder exits package body at glass parting line. 2. dimension g1, true position to be measured at datum -t-, seating plane. 3. dimensions r and u do not include glass protrusion. allowable glass protrusion is 0.25 (0.010) per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. -l- -m- -p- -n- y brk w d d v 84 1 s l m 0.18 (0.007) -m s t s n-p s s l m 0.18 (0.007) -m s t s n-p s a r g g1 s l s 0.25 (0.010) -m s t s n-p s c z j e detail s 0.100 (0.004) -t- seating plane s n m 0.25 (0.010) -p s t s l-m s s l m 0.18 (0.007) -m s t s n-p s s n-p s m 0.18 (0.007) t s l-m s s n-p s m 0.18 (0.007) t s l-m s b u z1 g1 x detail d-d s n-p s m 0.18 (0.007) t s l-m s h k1 k f detail s s l m 0.18 (0.007) -m s t s n-p s s n-p s m 0.18 (0.007) t s l-m s dim min max min max millimeters inches a 1.185 1.195 30.10 30.35 b 1.185 1.195 30.10 30.35 c 0.165 0.180 4.20 4.57 e 0.090 0.110 2.29 2.79 f 0.013 0.021 0.33 0.53 g 0.050 bsc 1.27 bsc h 0.026 0.032 0.66 0.81 j 0.020 --- 0.51 --- k 0.025 --- 0.64 --- r 1.150 1.156 29.21 29.36 u 1.150 1.156 29.21 29.36 v 0.042 0.048 1.07 1.21 w 0.042 0.048 1.07 1.21 x 0.042 0.056 1.07 1.42 y --- 0.020 --- 0.50 z 2 10 2 10 g1 1.110 1.130 28.20 28.70 k1 0.040 --- 1.02 --- z1 2 10 2 10 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data 80-pin quad flat pack (case 841b) m68hc11k family technical data motorola mechanical data 277 13.5 80-pin quad flat pack (case 841b) notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane -h- is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums -a-, -b- and -d- to be determined at datum plane -h-. 5. dimensions s and v to be determined at seating plane -c-. 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.25 per side. dimensions a and b do include mold mismatch and are determined at datum plane -h-. 7. dimension d does not include dambar protrusion. allowable dambar protrusion shall be 0.08 total in excess of the d dimension at maximum material condition. dambar cannot be located on the lower radius or the foot. section b-b 61 60 detail a l 41 40 80 -a- l -d- a s a-b m 0.20 d s h 0.05 a-b s 120 21 -b- b v j f n d view rotated 90 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 278 mechanical data motorola mechanical data 13.6 80-pin low-profile quad flat pack (case 917a) 1 20 21 40 41 60 61 80 view aa notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane -h- is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums -l-, -m- and -n- to be determined at datum plane -h-. 5. dimensions s and v to be determined at seating plane -t-. 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.250 (0.010) per side. dimensions a and b do include mold mismatch and are determined at datum plane -h-. 7. dimension d does not include dambar protrusion. dambar protrusion shall not cause the lead width to exceed 0.460 (0.018). minimum space between protrusion and adjacent lead or protrusion 0.07 (0.003). ab view y (k) (z) (w) view aa dim a min max min max inches 14.00 bsc 0.551 bsc millimeters a1 7.00 bsc 0.276 bsc b 14.00 bsc 0.551 bsc b1 7.00 bsc 0.276 bsc c --- 1.60 --- 0.063 c1 0.04 0.24 0.002 0.009 c2 1.30 1.50 0.051 0.059 d 0.22 0.38 0.009 0.015 e 0.40 0.75 0.016 0.030 f 0.17 0.33 0.007 0.013 g 0.65 bsc 0.026 bsc j 0.09 0.27 0.004 0.011 k 0.50 ref 0.020 ref p 0.325 bsc 0.013 ref r1 0.10 0.20 0.004 0.008 s 16.00 bsc 0.630 bsc s1 8.00 bsc 0.315 bsc u 0.09 0.16 0.004 0.006 v 16.00 bsc 0.630 bsc v1 8.00 bsc 0.315 bsc w 0.20 ref 0.008 ref z 1.00 ref 0.039 ref 0 01 --- --- 02 c2 c1 c l 0 10 0 9 14 0 10 0 9 14 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mechanical data 68-pin plastic leaded chip carrier (case 779) m68hc11k family technical data motorola mechanical data 279 13.7 68-pin plastic leaded chip carrier (case 779) notes: 1. datums l, m, and n determined where top of lead shoulder exits plastic body at mold parting line. 2. dimension g1, true position to be measured at datum t, seating plane. 3. dimensions r and u do not include mold flash. allowable mold flash is 0.010 per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. 6. the package top may be smaller than the package bottom by up to 0.012. dimensions r and u are determined at the outermost extremes of the plastic body exclusive of mold flash, tie bar burrs, gate burrs and interlead flash, but including any mismatch between the top and bottom of the plastic body. 7. dimension h does not include dambar protrusion or intrusion. the dambar protrusion(s) shall not cause the h dimension to be greater than 0.037. the dambar intrusion(s) shall not cause the h dimension to be smaller than 0.025. -n- -l- -m- brk y w v d d 68 1 a r g g1 e j view s c z s l-m m 0.007 n s t 0.004 -t- seating plane x z g1 view d-d u b dim min max inches a 0.985 0.995 b 0.985 0.995 c 0.165 0.180 e 0.090 0.110 f 0.013 0.019 g 0.050 bsc h 0.026 0.032 j 0.020 --- k 0.025 --- r 0.950 0.956 u 0.950 0.956 v 0.042 0.048 w 0.042 0.048 x 0.042 0.056 y --- 0.020 z 2 10 g1 0.910 0.930 k1 0.040 --- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 280 mechanical data motorola mechanical data 13.8 68-pin j-cerquad (case 779a) notes: 1. datums -l-, -m-, -n-, and -p- determined where top of lead shoulder exits plastic body at mold parting line. 2. dimension g1, true position to be measured at datum -t-, seating plane. 3. dimensions r and u do not include mold flash. allowable mold flash is 0.25 (0.010) per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. -n- -l- -m- brk y w v d d 68 1 a r g g1 e j detail s c 0.010 (0.04) -t- seating plane g1 detail d-d u b k f h detail s -p- s n m 0.25 (0.010) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s l s n m 0.25 (0.010) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s s n m 0.18 (0.007) -p s t s l-m s dim min max min max millimeters inches a 0.985 0.995 25.02 25.27 b 0.985 0.995 25.02 25.27 c 0.155 0.200 3.94 5.08 e 0.090 0.120 2.29 3.05 f 0.017 0.021 0.43 0.48 g 0.050 bsc 1.27 bsc h 0.026 0.032 0.66 0.81 j 0.020 --- 0.51 --- k 0.050 ref 1.27 ref l 0.003 --- 0.08 --- r 0.930 0.958 23.62 24.33 u 0.930 0.958 23.62 24.33 v 0.036 0.044 0.91 1.12 w 0.036 0.044 0.91 1.12 g1 0.890 0.930 22.61 23.62 z f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola ordering information 281 technical data ? m68hc11k family section 14. ordering information use table 14-1 to determine part numbers when placing an order. table 14-1. m68hc11k family devices device number rom or eprom ram eeprom i/o chip select slow mode packages mc68hc(l)11k0 mc68hc(l)11k1 mc68hc(l)11k4 0 0 24 k 768 768 768 0 640 640 37 37 62 yes yes yes no no no 84-pin plcc (1) 80-pin qfp (2) mc68hc711k4 24 k 768 640 62 yes no 84-pin j-cerquad (3) 84-pin plcc 80-pin qfp mc68hc11ks2 32 k 1 k 640 51 no yes 68-pin plcc 80-pin lqfp (4) mc68hc711ks2 32 k 1 k 640 51 no yes 68-pin plcc 80-pin lqfp 68-pin j-cerquad 1. plcc = plastic leaded chip carrier 2. qfp = quad flat pack 3. j-cerquad = ceramic windowed version of plcc 4. lqfp = low-profile quad flat pack f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 282 ordering information motorola ordering information f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola development support 283 technical data ? m68hc11k family section 15. development support motorola has developed tools for use in debugging and evaluating m68hc11 equipment. specific development tools for use with the m68hc11k series include:  m68hc11kevs evaluation system  m68hc711kpgmr programmer board  m68hc711kevb evaluation board for more information about motorola and third party development system hardware and software, contact one of the following:  local motorola sales office  world wide web at http://www.motorola.com/semiconductors f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 284 development support motorola development support f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc11k family technical data motorola index 285 technical data ? m68hc11k family index b baud baud rate scp[1:0] sci baud rate prescaler selects . . . . . . . . . . . . . . 159 c cforc timer compare force foc[1:5] force output comparison . . . . . . . . . . . . . . . . . . . . 201 config system configuration nocop rom/prom enable . . . . . . . . . . . . . . . . . . . . . . . . . 108 romon rom/prom enable . . . . . . . . . . . . . . . . . . . . . . . 88 , 89 h hprio highest priority i-bit interrupt and miscellaneous mda mode select a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 psel[3:0] priority select bits . . . . . . . . . . . . . . . . . . . . . . . . . 123 rboot read bootstrap rom . . . . . . . . . . . . . . . . . . . . . . . . . 80 smod special mode select . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 i init ram and i/o mapping register ram[3:0] ram map position. . . . . . . . . . . . . . . . . . . . . . . . . . . 84 reg[3:0] register block position . . . . . . . . . . . . . . . . . . . . . . . 84 l lirdv lir driven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 o oc1d output compare 1 data oc1d[7:3] output compare masks. . . . . . . . . . . . . . . . . . . . . 203 oc1m output compare 1 mask oc1m[7:3] output compare 1 masks . . . . . . . . . . . . . . . . . . . 202 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 286 index motorola index option system configuration options cme clock monitor enable . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 cr[1:0] cop timer rate select bits. . . . . . . . . . . . . . . . . . . . 109 dly enable oscillator startup delay. . . . . . . . . . . . . . . . . . . . 132 irqe configure irq for edge-sensitive operation. . . . . . . . . 121 p pactl pulse accumulator control i4/o5 input capture 4/output compare 5 . . . . . . . . . . . . . . . . 191 paen pulse accumulator system enable. . . . . . . . . . . . . . . . 205 pamod pulse accumulator mode . . . . . . . . . . . . . . . . . . . . . 206 rtr[1:0] real time interrupt rate select. . . . . . . . . . . . . . . . 210 pprog eprom programming control elat prom latch control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 s sccr1 sci control register 1 m mode (sci word size). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 wake wakeup mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 sccr2 sci control register 2 ilie idle line interrupt enable . . . . . . . . . . . . . . . . . . . . . . . . . 161 re receiver enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 rie receiver interrupt enable. . . . . . . . . . . . . . . . . . . . . . . . . 161 rwu receiver wakeup control . . . . . . . . . . . . . . . . . . . . . . . 162 tcie transmit complete interrupt enable . . . . . . . . . . . . . . . 161 te transmitter enable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 tie transmit interrupt enable . . . . . . . . . . . . . . . . . . . . . . . . . 161 sci control register 2 sbk send break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 scsr sci status register fe framing error flag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 idle idle line detected flag. . . . . . . . . . . . . . . . . . . . . . . . . . 163 nf noise error flag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 or overrun error flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 rdrf receive data register full flag. . . . . . . . . . . . . . . . . . 163 tc transmit complete flag . . . . . . . . . . . . . . . . . . . . . . . . . . 163 tdre transmit data register empty flag . . . . . . . . . . . . . . . 163 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index m68hc11k family technical data motorola index 287 spcr serial peripheral control register cpha clock phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 cpol clock polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 dwom port d wired-or mode. . . . . . . . . . . . . . . . . . . . . . . . 174 mstr master mode select . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 spe serial peripheral system enable. . . . . . . . . . . . . . . . . . . 174 spr[1:0] spi clock rate selects . . . . . . . . . . . . . . . . . . . . . . 175 spsr serial peripheral status register modf mode fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 spif spi transfer complete flag . . . . . . . . . . . . . . . . . . . . . . 176 wcol write collision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 t tctl1 timer control 1 om[2:5] output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 tctl2 timer control 2 edgxb and edgxa input capture edge control . . . . . . . . . . 195 tflg1 timer interrupt flag 1 i4/o5f input capture 4/output compare 5 flag . . . . . . . 194 , 199 ic1f ? ic3f input capture x flag . . . . . . . . . . . . . . . . . . . . . . . 194 oc1f ? oc4f output compare x flag . . . . . . . . . . . . . . . . . . . 199 tflg2 timer interrupt flag 2 paif pulse accumulator input edge flag . . . . . . . . . . . . . . . . 207 paovf pulse accumulator overflow flag . . . . . . . . . . . . . . . 207 rtif real-time interrupt flag. . . . . . . . . . . . . . . . . . . . . . . . . 209 tof timer overflow interrupt flag . . . . . . . . . . . . . . . . . . . . . 189 tmsk1 timer interrupt mask 1 i4/o5i input capture 4 or output compare 5 interrupt enable . . . . . . . 195 , 200 ic1i ? ic3i input capture x interrupt enable . . . . . . . . . . . . . . . 194 oc1i ? oc4 output compare x interrupt enable . . . . . . . . . . . 200 tmsk2 timer interrupt mask 2 pr[1:0] timer prescaler select . . . . . . . . . . . . . . . . . . . . . . . . 190 rtii real-time interrupt enable. . . . . . . . . . . . . . . . . . . . . . . . 209 toi timer overflow interrupt enable. . . . . . . . . . . . . . . . . . . . 189 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
technical data m68hc11k family 288 index motorola index f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
blank f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
m68hc 1 1k/d m 68h11e series technical data q4/00 rev 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of MC711K4CFNE3

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X